Skip to content

Commit

Permalink
Check that correct emails are sent correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
zwolf committed Dec 5, 2023
1 parent 968cf88 commit 4091a43
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions spec/controllers/registrations_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4091a43

Please sign in to comment.