Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy Andrew <mail@timothyandrew.net>2016-07-05 07:50:32 +0300
committerTimothy Andrew <mail@timothyandrew.net>2016-07-05 07:50:32 +0300
commitf617bd76907e45d9103d768a02fbccb451524b35 (patch)
tree5eeb8618a827289804624fd2f5cdc699a1e25858 /spec/controllers/registrations_controller_spec.rb
parent0d68e19909824c24ff77bf6bb6ebf2db4716784b (diff)
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.
Diffstat (limited to 'spec/controllers/registrations_controller_spec.rb')
-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