Commit f617bd76 authored by Timothy Andrew's avatar Timothy Andrew

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.
parent 0d68e199
No related merge requests found
......@@ -14,8 +14,7 @@ describe RegistrationsController do
before { allow_any_instance_of(ApplicationSetting).to receive(:send_user_confirmation_email).and_return(false) }
it 'logs user in directly' do
post(:create, user_params)
expect(ActionMailer::Base.deliveries.last).to be_nil
expect { post(:create, user_params) }.not_to change{ ActionMailer::Base.deliveries.size }
expect(subject.current_user).not_to be_nil
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment