I had some issues with sending confirmation emails in Devise. That's why I would like to write tests for this functionality. How could I do this, when I don't create my own mailers?
EDIT
I decided, that this should be enough:
it 'should send an email' do
user
put :complete, params
user.send(:send_confirmation_notification?).should == true
end
Please, let me know if I missed something.
Devise.mailer.deliveries.size
orActionMailer::Base.deliveries.size
as they are always0
therefore only way how to test this is withuser.send_confirmation_notification?
like example in the question. Careful doh ! don't useuser.confirmed_at?
asuser.skip_confirmation!
is setting this flag – Neomineomycin