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