From 4091a433c66ac8dece934e3de2f2a6012974203d Mon Sep 17 00:00:00 2001 From: Zach Wolfenbarger Date: Tue, 5 Dec 2023 15:09:29 -0600 Subject: [PATCH] Check that correct emails are sent correctly --- .../controllers/registrations_controller_spec.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/spec/controllers/registrations_controller_spec.rb b/spec/controllers/registrations_controller_spec.rb index e0ef85c3a..96dfbea7e 100644 --- a/spec/controllers/registrations_controller_spec.rb +++ b/spec/controllers/registrations_controller_spec.rb @@ -149,8 +149,8 @@ post :create, params: { user: user_attributes } end - it "should queue a welcome worker to send an email" do - expect(UserWelcomeMailerWorker).to receive(:perform_async) + it "should send a confirmation instructions email" do + expect_any_instance_of(User).to receive(:send_confirmation_instructions).once post :create, params: { user: user_attributes } end @@ -212,8 +212,8 @@ end end - it "should not queue a welcome worker to send an email" do - expect(UserWelcomeMailerWorker).to_not receive(:perform_async) + it "should not send a confirmation instructions email" do + expect_any_instance_of(User).to_not receive(:send_confirmation_instructions) post :create, params: { user: user_attributes } end end @@ -279,8 +279,8 @@ post :create, params: { user: user_attributes } end - it "should queue a welcome worker to send an email" do - expect(UserWelcomeMailerWorker).to receive(:perform_async) + it "should send a confirmation instructions email" do + expect_any_instance_of(User).to receive(:send_confirmation_instructions).once post :create, params: { user: user_attributes } end end @@ -313,8 +313,8 @@ expect(User.where(login: user_attributes[:login])).to_not exist end - it "should not queue a welcome worker to send an email" do - expect(UserWelcomeMailerWorker).to_not receive(:perform_async) + it "should not send a confirmation instructions email" do + expect_any_instance_of(User).to_not receive(:send_confirmation_instructions) post :create, params: { user: user_attributes } end end