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.
This commit is contained in:
Javi Martín
2025-02-27 13:39:41 +01:00
parent db9b849d82
commit 248b826f20

View File

@@ -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"