From 12f2c95844764388cebf4290aee3f1ee5789a148 Mon Sep 17 00:00:00 2001 From: MadeTech Dushan Date: Fri, 12 Nov 2021 10:02:28 +0000 Subject: [PATCH] Add test for password reset email --- spec/features/user_spec.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spec/features/user_spec.rb b/spec/features/user_spec.rb index 408ffbd40..d5b245521 100644 --- a/spec/features/user_spec.rb +++ b/spec/features/user_spec.rb @@ -43,5 +43,11 @@ RSpec.describe "User Features" do click_button("Send email") expect(page).to have_current_path("/confirmations/reset?email=idontexist%40example.com") end + + it " is sent a reset password email" do + visit("/users/password/new") + fill_in("user_email", with: "test@example.com") + expect{click_button("Send email")}.to change{ActionMailer::Base.deliveries.count}.by(1) + end end end