Assert against ActionMailer::Base.deliveries
relatively.
- Look for a `change` in its size rather than asserting against an actual size. - This previously failed because another spec had an email in `ActionMailer::Base.deliveries`, which failed this `be_nil` assertion.
This commit is contained in:
parent
0d68e19909
commit
f617bd7690
1 changed files with 1 additions and 2 deletions
|
@ -14,8 +14,7 @@ describe RegistrationsController do
|
||||||
before { allow_any_instance_of(ApplicationSetting).to receive(:send_user_confirmation_email).and_return(false) }
|
before { allow_any_instance_of(ApplicationSetting).to receive(:send_user_confirmation_email).and_return(false) }
|
||||||
|
|
||||||
it 'logs user in directly' do
|
it 'logs user in directly' do
|
||||||
post(:create, user_params)
|
expect { post(:create, user_params) }.not_to change{ ActionMailer::Base.deliveries.size }
|
||||||
expect(ActionMailer::Base.deliveries.last).to be_nil
|
|
||||||
expect(subject.current_user).not_to be_nil
|
expect(subject.current_user).not_to be_nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue