From 248b826f20c6556ecd2a47ca9d803f318ac1ff4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Thu, 27 Feb 2025 13:39:41 +0100 Subject: [PATCH] Merge reset password tests together Since system tests are slow, and these tests were almost identical, we're merging them into one to make them faster. --- spec/system/management/account_spec.rb | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/spec/system/management/account_spec.rb b/spec/system/management/account_spec.rb index 0507affe1..6802a711d 100644 --- a/spec/system/management/account_spec.rb +++ b/spec/system/management/account_spec.rb @@ -27,7 +27,7 @@ describe "Account" do expect(email).to have_text "Change your password" end - scenario "Manager changes the password by hand (writen by them)" do + scenario "Manager manually writes the new password" do user = create(:user, :level_three) login_managed_user(user) @@ -39,6 +39,8 @@ describe "Account" do click_button "Save password" expect(page).to have_content "Password reseted successfully" + expect(page).to have_link "Print password", href: "javascript:window.print();" + expect(page).to have_css "div.for-print-only", text: "new_password", visible: :hidden logout @@ -68,22 +70,6 @@ describe "Account" do expect(page).to have_content "You have been signed in successfully." end - scenario "The password is printed" do - user = create(:user, :level_three) - login_managed_user(user) - - login_as_manager - click_link "Reset password manually" - - fill_in "Password", with: "another_new_password" - - click_button "Save password" - - expect(page).to have_content "Password reseted successfully" - expect(page).to have_link "Print password", href: "javascript:window.print();" - expect(page).to have_css("div.for-print-only", text: "another_new_password", visible: :hidden) - end - describe "When a user has not been selected" do before do Setting["feature.user.skip_verification"] = "true"