-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cover missing and not matching passwords scenarios in Admin update tests
- Loading branch information
Showing
2 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -111,5 +111,62 @@ def test_god_admin_update | |
end | ||
end | ||
end | ||
|
||
def test_admin_update_with_not_matching_passwords | ||
with_signed_in_admin(manager_admin) do | ||
visit edit_admin_admin_path(regular_admin) | ||
|
||
within "form.edit_admin" do | ||
fill_in "admin_name", with: "Admin Name" | ||
fill_in "admin_email", with: "[email protected]" | ||
fill_in "admin_password", with: "wadus" | ||
fill_in "admin_password_confirmation", with: "foo" | ||
|
||
within ".site-module-check-boxes" do | ||
check "Gobierto Development" | ||
end | ||
|
||
within ".site-check-boxes" do | ||
check "madrid.gobierto.dev" | ||
end | ||
|
||
within ".admin-authorization-level-radio-buttons" do | ||
choose "Regular" | ||
end | ||
|
||
click_button "Update" | ||
end | ||
|
||
assert has_alert?("Password confirmation doesn't match Password") | ||
end | ||
end | ||
|
||
def test_admin_update_with_no_password_confirmation | ||
with_signed_in_admin(manager_admin) do | ||
visit edit_admin_admin_path(regular_admin) | ||
|
||
within "form.edit_admin" do | ||
fill_in "admin_name", with: "Admin Name" | ||
fill_in "admin_email", with: "[email protected]" | ||
fill_in "admin_password", with: "wadus" | ||
|
||
within ".site-module-check-boxes" do | ||
check "Gobierto Development" | ||
end | ||
|
||
within ".site-check-boxes" do | ||
check "madrid.gobierto.dev" | ||
end | ||
|
||
within ".admin-authorization-level-radio-buttons" do | ||
choose "Regular" | ||
end | ||
|
||
click_button "Update" | ||
end | ||
|
||
assert has_alert?("Password confirmation doesn't match Password") | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters