It\'s my understanding that Rails\' testing environment is torn down and rebuilt before each test...so how do I test a controller that requires that a user be logged in and
For Devise 4.2 it's now confirm (not confirm!).
Source
4.2.0 - 2016-07-01
Remove the Devise::Models::Confirmable#confirm! method, use confirm instead.
Code below also prevents mailers from being generated thanks to after(:build) vs after(:create) for setting confirmed_at
FactoryGirl.define do
factory :user do
after(:build) { |u| u.skip_confirmation_notification! }
after(:create) { |u| u.confirm }
...
end
end