diff --git a/spec/requests/users/passwords_controller_spec.rb b/spec/requests/users/passwords_controller_spec.rb index 88e68658d..0da90d6e9 100644 --- a/spec/requests/users/passwords_controller_spec.rb +++ b/spec/requests/users/passwords_controller_spec.rb @@ -30,7 +30,7 @@ RSpec.describe Users::PasswordsController, type: :request do expect(response.body).to match(/Check your email/) end - + end context "when a password reset is requested the email" do @@ -40,8 +40,9 @@ RSpec.describe Users::PasswordsController, type: :request do it "should contain the correct email" do post "/users/password", params: params follow_redirect! - binding.pry - expect ( ActionMailer::Base.deliveries.last.body.raw_source ).to contain( email ) + email_ascii_content = ActionMailer::Base.deliveries.last.body.raw_source + email_content = email_ascii_content.encode("ASCII", "UTF-8", undef: :replace) + expect(email_content).to match(email) end end end