From cf000c76d5ca5a96f9e80201cd39a8767012048d Mon Sep 17 00:00:00 2001 From: Matthew Phelan Date: Thu, 18 Nov 2021 09:45:25 +0000 Subject: [PATCH] Reset email specs --- spec/requests/users/passwords_controller_spec.rb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/spec/requests/users/passwords_controller_spec.rb b/spec/requests/users/passwords_controller_spec.rb index 7a30622dd..88e68658d 100644 --- a/spec/requests/users/passwords_controller_spec.rb +++ b/spec/requests/users/passwords_controller_spec.rb @@ -30,10 +30,18 @@ RSpec.describe Users::PasswordsController, type: :request do expect(response.body).to match(/Check your email/) end - it "shows a flash banner" do + + end + + context "when a password reset is requested the email" do + let(:user) { FactoryBot.create(:user) } + let(:email) { user.email } + + it "should contain the correct email" do post "/users/password", params: params follow_redirect! - expect(flash[:notice]).to be_present + binding.pry + expect ( ActionMailer::Base.deliveries.last.body.raw_source ).to contain( email ) end end end