Although recently I think I found the solution. Randomly looking around the devise library code, I found this little snippet that adds “context” blocks to the default test framework so its easier to organize your tests.
Here’s an example:
```ruby class SampleTest < ActiveSupport::TestCase # # This method lets us add “context” blocks in our tests # def self.context(name, &block) instance_eval(&block) end
# We can then use the context block… context “When saving” do test “should validate name” do # … end end end ```
So there you go. A quick way of adding
context blocks to Rails.