File tree Expand file tree Collapse file tree
lib/generators/alchemy/devise/install/templates Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ Devise.setup do |config|
9090 # It will change confirmation, password recovery and other workflows
9191 # to behave the same regardless if the e-mail provided was right or wrong.
9292 # Does not affect registerable.
93- # config.paranoid = true
93+ config.paranoid = true
9494
9595 # By default Devise will store the user in session. You can skip storage for
9696 # particular strategies by setting this option.
Original file line number Diff line number Diff line change 2020 . to have_content ( "You will receive an email with instructions on how to reset your password in a few minutes." )
2121 end
2222
23- it "Displays error if email not found." do
24- visit admin_new_password_path
23+ context "with paranoid mode disabled" do
24+ before do
25+ allow ( Devise ) . to receive ( :paranoid ) . and_return ( false )
26+ end
2527
26- fill_in :user_email , with : "wrong@email.com"
27- click_button "Send reset instructions"
28+ it "Displays error if email not found." do
29+ visit admin_new_password_path
30+
31+ fill_in :user_email , with : "wrong@email.com"
32+ click_button "Send reset instructions"
33+
34+ expect ( page ) . to have_content ( "Email not found" )
35+ end
36+ end
37+
38+ context "with paranoid mode enabled" do
39+ before do
40+ allow ( Devise ) . to receive ( :paranoid ) . and_return ( true )
41+ end
42+
43+ it "Displays notification about reset instructions." , :js do
44+ visit admin_new_password_path
45+
46+ fill_in :user_email , with : "wrong@email.com"
47+ click_button "Send reset instructions"
2848
29- expect ( page ) . to have_content ( "Email not found" )
49+ expect ( page ) . to have_content (
50+ "If your email address exists in our database, you will receive a password recovery link"
51+ )
52+ end
3053 end
3154
3255 it "User can visit edit password form." do
You can’t perform that action at this time.
0 commit comments