summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy Andrew <mail@timothyandrew.net>2016-07-05 10:20:32 +0530
committerTimothy Andrew <mail@timothyandrew.net>2016-07-05 10:20:32 +0530
commitf617bd76907e45d9103d768a02fbccb451524b35 (patch)
tree5eeb8618a827289804624fd2f5cdc699a1e25858
parent0d68e19909824c24ff77bf6bb6ebf2db4716784b (diff)
downloadgitlab-ce-f617bd76907e45d9103d768a02fbccb451524b35.tar.gz
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.
-rw-r--r--spec/controllers/registrations_controller_spec.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/spec/controllers/registrations_controller_spec.rb b/spec/controllers/registrations_controller_spec.rb
index 209fa37d97d..026f41c926b 100644
--- a/spec/controllers/registrations_controller_spec.rb
+++ b/spec/controllers/registrations_controller_spec.rb
@@ -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