-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
eba3116
commit eca248f
Showing
18 changed files
with
62 additions
and
62 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
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
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
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
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
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
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
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
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
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 |
---|---|---|
|
@@ -18,17 +18,17 @@ | |
scenario "I sign in as a lead mentor user and invite a user to a school" do | ||
sign_in_as_lead_mentor_user | ||
visit_claims_school_users_page | ||
click_on_add_user | ||
when_i_click("Add user") | ||
fill_in_user_details | ||
check_user_details | ||
click_on_add_user | ||
when_i_click("Save user") | ||
verify_user_added | ||
end | ||
|
||
scenario "I sign in as a lead mentor user and enter invalid user details" do | ||
sign_in_as_lead_mentor_user | ||
visit_claims_school_users_page | ||
click_on_add_user | ||
when_i_click("Add user") | ||
fill_in_invalid_user_details | ||
then_see_error_message | ||
end | ||
|
@@ -43,12 +43,12 @@ | |
scenario "I try to add a user who already exists" do | ||
sign_in_as_lead_mentor_user | ||
visit_claims_school_users_page | ||
click_on_add_user | ||
when_i_click("Add user") | ||
fill_in_user_details | ||
check_user_details | ||
click_on_add_user | ||
when_i_click("Save user") | ||
and_user_is_added | ||
click_on_add_user | ||
when_i_click("Add user") | ||
fill_in_user_details | ||
then_see_error_message_for_existing_user | ||
end | ||
|
@@ -61,14 +61,14 @@ | |
scenario "I use back or change to edit my answers" do | ||
sign_in_as_lead_mentor_user | ||
visit_claims_school_users_page | ||
click_on_add_user | ||
when_i_click("Add user") | ||
fill_in_user_details | ||
check_user_details | ||
click_back | ||
check_form_is_populated | ||
edit_first_name | ||
check_user_details_updated | ||
click_on_add_user | ||
when_i_click("Save user") | ||
verify_edited_user_added | ||
end | ||
|
||
|
@@ -166,8 +166,8 @@ def check_user_details | |
expect(page).to have_content("[email protected]") | ||
end | ||
|
||
def click_on_add_user | ||
click_on "Add user" | ||
def when_i_click(button) | ||
click_on button | ||
end | ||
|
||
def click_back | ||
|
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 |
---|---|---|
|
@@ -12,9 +12,9 @@ | |
scenario "I sign in as a lead mentor user and invite a user to a school and view that users details" do | ||
sign_in_as_lead_mentor_user | ||
visit_claims_school_users_page | ||
click_on_add_user | ||
when_i_click("Add user") | ||
fill_in_user_details | ||
click_on_add_user | ||
when_i_click("Save user") | ||
show_user_details | ||
end | ||
|
||
|
@@ -49,7 +49,7 @@ def show_user_details | |
expect(page).to have_content("\nEmail [email protected]") | ||
end | ||
|
||
def click_on_add_user | ||
click_on "Add user" | ||
def when_i_click(button) | ||
click_on button | ||
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
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
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
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
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 |
---|---|---|
|
@@ -13,62 +13,62 @@ | |
scenario "I sign in as a support user and invite a user to a school" do | ||
sign_in_as_support_user | ||
visit_claims_support_school_users_page | ||
click_on_add_user | ||
when_i_click("Add user") | ||
fill_in_user_details | ||
check_user_details | ||
click_on_add_user | ||
when_i_click("Save user") | ||
verify_user_added | ||
end | ||
|
||
scenario "I sign in as a support user and enter invalid user details" do | ||
sign_in_as_support_user | ||
visit_claims_support_school_users_page | ||
click_on_add_user | ||
when_i_click("Add user") | ||
fill_in_invalid_user_details | ||
then_see_error_message | ||
end | ||
|
||
scenario "I try to add a user who already exists" do | ||
sign_in_as_support_user | ||
visit_claims_support_school_users_page | ||
click_on_add_user | ||
when_i_click("Add user") | ||
fill_in_user_details | ||
check_user_details | ||
click_on_add_user | ||
when_i_click("Save user") | ||
and_user_is_added | ||
click_on_add_user | ||
when_i_click("Add user") | ||
fill_in_user_details | ||
then_see_error_message_for_existing_user | ||
end | ||
|
||
scenario "I add a user to different schools" do | ||
sign_in_as_support_user | ||
visit_claims_support_school_users_page | ||
click_on_add_user | ||
when_i_click("Add user") | ||
fill_in_user_details | ||
check_user_details | ||
click_on_add_user | ||
when_i_click("Save user") | ||
verify_user_added | ||
|
||
visit_another_claims_support_school_users_page | ||
click_on_add_user | ||
when_i_click("Add user") | ||
fill_in_user_details | ||
check_user_details | ||
click_on_add_user | ||
when_i_click("Save user") | ||
verify_user_added_to_another_school | ||
end | ||
|
||
scenario "I use back or change to edit my answers" do | ||
sign_in_as_support_user | ||
visit_claims_support_school_users_page | ||
click_on_add_user | ||
when_i_click("Add user") | ||
fill_in_user_details | ||
check_user_details | ||
click_back | ||
check_form_is_populated | ||
edit_first_name | ||
check_user_details_updated | ||
click_on_add_user | ||
when_i_click("Save user") | ||
verify_edited_user_added | ||
end | ||
|
||
|
@@ -143,8 +143,8 @@ def check_user_details | |
expect(page).to have_content("[email protected]") | ||
end | ||
|
||
def click_on_add_user | ||
click_on "Add user" | ||
def when_i_click(button) | ||
click_on button | ||
end | ||
|
||
def click_back | ||
|
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 |
---|---|---|
|
@@ -12,18 +12,18 @@ | |
scenario "Add a support user" do | ||
given_i_sign_in_as(support_user) | ||
and_i_visit_the_support_users_page | ||
and_i_click_on_add_a_support_user | ||
when_i_click("Add user") | ||
and_i_fill_in_the_support_user_form(email_address: "[email protected]") | ||
then_i_am_redirected_to_check_the_support_user_details | ||
when_i_click_on_add_user | ||
when_i_click("Save user") | ||
then_i_see_the_support_user_has_been_added(email_address: "[email protected]") | ||
and_an_email_is_sent_to_the_support_user(email_address: "[email protected]") | ||
end | ||
|
||
scenario "Attempt to add a support user without an @education.gov.uk email address" do | ||
given_i_sign_in_as(support_user) | ||
and_i_visit_the_support_users_page | ||
and_i_click_on_add_a_support_user | ||
when_i_click("Add user") | ||
and_i_fill_in_the_support_user_form(email_address: "[email protected]") | ||
then_i_see_an_error("Enter a Department for Education email address in the correct format, like [email protected]") | ||
and_the_page_title_is("Error: Personal details - Add user - Claim funding for mentor training") | ||
|
@@ -33,7 +33,7 @@ | |
given_there_is_a_support_user_with(email_address: "[email protected]") | ||
given_i_sign_in_as(support_user) | ||
and_i_visit_the_support_users_page | ||
and_i_click_on_add_a_support_user | ||
when_i_click("Add user") | ||
and_i_fill_in_the_support_user_form(email_address: "[email protected]") | ||
then_i_see_an_error("Email address already in use") | ||
and_the_page_title_is("Error: Personal details - Add user - Claim funding for mentor training") | ||
|
@@ -42,12 +42,12 @@ | |
scenario "Make changes while adding a support user" do | ||
given_i_sign_in_as(support_user) | ||
and_i_visit_the_support_users_page | ||
and_i_click_on_add_a_support_user | ||
when_i_click("Add user") | ||
and_i_fill_in_the_support_user_form(email_address: "[email protected]") | ||
and_i_click_on_a_change_link | ||
then_i_should_see_the_support_user_form_with(email_address: "[email protected]") | ||
when_i_fill_in_the_support_user_form(email_address: "[email protected]") | ||
and_i_click_on_add_user | ||
when_i_click("Save user") | ||
then_i_see_the_support_user_has_been_added(email_address: "[email protected]") | ||
and_an_email_is_sent_to_the_support_user(email_address: "[email protected]") | ||
end | ||
|
@@ -85,10 +85,9 @@ def then_i_am_redirected_to_check_the_support_user_details | |
expect(page).to have_content "[email protected]" | ||
end | ||
|
||
def when_i_click_on_add_user | ||
click_on "Add user" | ||
def when_i_click(button) | ||
click_on button | ||
end | ||
alias_method :and_i_click_on_add_user, :when_i_click_on_add_user | ||
|
||
def then_i_see_the_support_user_has_been_added(email_address:) | ||
expect(page).to have_content "User added" | ||
|
Oops, something went wrong.