-
Notifications
You must be signed in to change notification settings - Fork 2
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
Showing
13 changed files
with
805 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
claim_reference,school_urn,school_name,claim_status | ||
12345678,1234567,Example School,clawback_requested | ||
23456789,2345678,Example School 2,clawback_requested |
103 changes: 103 additions & 0 deletions
103
...pport/claims/activity_logs/support_user_views_clawback_request_delivered_activity_spec.rb
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 |
---|---|---|
@@ -0,0 +1,103 @@ | ||
require "rails_helper" | ||
|
||
RSpec.describe "Support user views clawback request delivered activity spec", service: :claims, type: :system do | ||
scenario do | ||
given_clawback_request_delivered_activity_exists | ||
and_i_am_signed_in | ||
then_i_see_the_organisations_page | ||
|
||
when_i_click_on_claims | ||
then_i_see_the_claims_page | ||
|
||
when_i_click_on_activity_log | ||
then_i_see_the_activity_log_page | ||
|
||
when_i_click_on_view_details | ||
then_i_see_the_activity_details | ||
|
||
when_i_click_on_download_csv | ||
then_i_receive_a_csv_file | ||
end | ||
|
||
def given_clawback_request_delivered_activity_exists | ||
@colin = build(:claims_support_user, :colin) | ||
|
||
@best_practice_network = build(:claims_provider, name: "Best Practice Network") | ||
@best_practice_network_claim = build(:claim, :payment_in_progress, submitted_at: 1.day.ago, reference: "12345678", provider: @best_practice_network) | ||
|
||
@niot = build(:claims_provider, name: "National Institute of Technology") | ||
@niot_claim = build(:claim, :payment_in_progress, submitted_at: 1.day.ago, reference: "87654321", provider: @niot) | ||
|
||
@clawback = build(:clawback, claims: [@best_practice_network_claim, @niot_claim]) | ||
@activity_log = create(:claim_activity, :clawback_request_delivered, user: @colin, record: @clawback) | ||
end | ||
|
||
def and_i_am_signed_in | ||
sign_in_claims_support_user | ||
end | ||
|
||
def then_i_see_the_organisations_page | ||
expect(page).to have_title("Organisations (2) - Claim funding for mentor training - GOV.UK") | ||
expect(page).to have_h1("Organisations (2)") | ||
end | ||
|
||
def when_i_click_on_claims | ||
click_on("Claims") | ||
end | ||
|
||
def then_i_see_the_claims_page | ||
expect(page).to have_title("Claims - Claim funding for mentor training - GOV.UK") | ||
expect(primary_navigation).to have_current_item("Claims") | ||
expect(page).to have_h1("Claims") | ||
expect(secondary_navigation).to have_current_item("All claims") | ||
end | ||
|
||
def when_i_click_on_activity_log | ||
click_on("Activity log") | ||
end | ||
|
||
def then_i_see_the_activity_log_page | ||
expect(page).to have_title("Claims - Claim funding for mentor training - GOV.UK") | ||
expect(primary_navigation).to have_current_item("Claims") | ||
expect(page).to have_h1("Claims") | ||
expect(secondary_navigation).to have_current_item("Activity log") | ||
expect(page).to have_h2("Activity log") | ||
expect(page).to have_element("h3", class: "app-timeline__title", text: "Claims sent to payer for clawback") | ||
expect(page).to have_link("View details", href: claims_support_claims_claim_activity_path(@activity_log)) | ||
end | ||
|
||
def when_i_click_on_view_details | ||
click_on("View details") | ||
end | ||
|
||
def then_i_see_the_activity_details | ||
expect(page).to have_title("Claims sent to payer for clawback - Claim funding for mentor training - GOV.UK") | ||
expect(primary_navigation).to have_current_item("Claims") | ||
expect(page).to have_h1("Claims sent to payer for clawback") | ||
expect(page).to have_link("12345678", href: claims_support_claim_path(@best_practice_network_claim)) | ||
expect(page).to have_link("Resend email to payer", href: resend_email_claims_support_claims_claim_activity_path(@activity_log)) | ||
expect(page).to have_h2("Providers") | ||
expect(page).to have_h3("Best Practice Network") | ||
expect(page).to have_table_row({ | ||
"Claim reference" => "12345678", | ||
"Number of mentors" => "0", | ||
"Claim amount" => "£#{@best_practice_network_claim.amount}", | ||
}) | ||
|
||
expect(page).to have_h3("National Institute of Technology") | ||
expect(page).to have_table_row({ | ||
"Claim reference" => "87654321", | ||
"Number of mentors" => "0", | ||
"Claim amount" => "£#{@niot_claim.amount}", | ||
}) | ||
end | ||
|
||
def when_i_click_on_download_csv | ||
click_on "Download CSV" | ||
end | ||
|
||
def then_i_receive_a_csv_file | ||
expect(page.response_headers["Content-Type"]).to eq("text/csv") | ||
expect(page.response_headers["Content-Disposition"]).to eq("attachment; filename=\"example-clawbacks.csv\"; filename*=UTF-8''example-clawbacks.csv") | ||
end | ||
end |
79 changes: 79 additions & 0 deletions
79
...laims/support/claims/activity_logs/support_user_views_clawback_requested_activity_spec.rb
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 |
---|---|---|
@@ -0,0 +1,79 @@ | ||
require "rails_helper" | ||
|
||
RSpec.describe "Support user views clawback requested activity spec", service: :claims, type: :system do | ||
scenario do | ||
given_clawback_requested_activity_exists | ||
and_i_am_signed_in | ||
then_i_see_the_organisations_page | ||
|
||
when_i_click_on_claims | ||
then_i_see_the_claims_page | ||
|
||
when_i_click_on_activity_log | ||
then_i_see_the_activity_log_page | ||
|
||
when_i_click_on_view_details | ||
then_i_see_the_activity_details | ||
end | ||
|
||
def given_clawback_requested_activity_exists | ||
@colin = build(:claims_support_user, :colin) | ||
|
||
@best_practice_network = build(:claims_provider, name: "Best Practice Network") | ||
@best_practice_network_claim = build(:claim, :payment_in_progress, submitted_at: 1.day.ago, reference: "12345678", provider: @best_practice_network) | ||
|
||
@activity_log = create(:claim_activity, :clawback_requested, user: @colin, record: @best_practice_network_claim) | ||
end | ||
|
||
def and_i_am_signed_in | ||
sign_in_claims_support_user | ||
end | ||
|
||
def then_i_see_the_organisations_page | ||
expect(page).to have_title("Organisations (1) - Claim funding for mentor training - GOV.UK") | ||
expect(page).to have_h1("Organisations (1)") | ||
end | ||
|
||
def when_i_click_on_claims | ||
click_on("Claims") | ||
end | ||
|
||
def then_i_see_the_claims_page | ||
expect(page).to have_title("Claims - Claim funding for mentor training - GOV.UK") | ||
expect(primary_navigation).to have_current_item("Claims") | ||
expect(page).to have_h1("Claims") | ||
expect(secondary_navigation).to have_current_item("All claims") | ||
end | ||
|
||
def when_i_click_on_activity_log | ||
click_on("Activity log") | ||
end | ||
|
||
def then_i_see_the_activity_log_page | ||
expect(page).to have_title("Claims - Claim funding for mentor training - GOV.UK") | ||
expect(primary_navigation).to have_current_item("Claims") | ||
expect(page).to have_h1("Claims") | ||
expect(secondary_navigation).to have_current_item("Activity log") | ||
expect(page).to have_h2("Activity log") | ||
expect(page).to have_element("h3", class: "app-timeline__title", text: "Clawback requested") | ||
expect(page).to have_link("View details", href: claims_support_claims_claim_activity_path(@activity_log)) | ||
end | ||
|
||
def when_i_click_on_view_details | ||
click_on("View details") | ||
end | ||
|
||
def then_i_see_the_activity_details | ||
expect(page).to have_title("Clawback requested - Claim funding for mentor training - GOV.UK") | ||
expect(primary_navigation).to have_current_item("Claims") | ||
expect(page).to have_h1("Clawback requested") | ||
expect(page).to have_link("12345678", href: claims_support_claim_path(@best_practice_network_claim)) | ||
expect(page).to have_h2("Providers") | ||
expect(page).to have_h3("Best Practice Network") | ||
expect(page).to have_table_row({ | ||
"Claim reference" => "12345678", | ||
"Number of mentors" => "0", | ||
"Claim amount" => "£#{@best_practice_network_claim.amount}", | ||
}) | ||
end | ||
end |
102 changes: 102 additions & 0 deletions
102
...pport/claims/activity_logs/support_user_views_clawback_response_uploaded_activity_spec.rb
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 |
---|---|---|
@@ -0,0 +1,102 @@ | ||
require "rails_helper" | ||
|
||
RSpec.describe "Support user views clawback response uploaded activity spec", service: :claims, type: :system do | ||
scenario do | ||
given_clawback_response_uploaded_activity_exists | ||
and_i_am_signed_in | ||
then_i_see_the_organisations_page | ||
|
||
when_i_click_on_claims | ||
then_i_see_the_claims_page | ||
|
||
when_i_click_on_activity_log | ||
then_i_see_the_activity_log_page | ||
|
||
when_i_click_on_view_details | ||
then_i_see_the_activity_details | ||
|
||
when_i_click_on_download_csv | ||
then_i_receive_a_csv_file | ||
end | ||
|
||
def given_clawback_response_uploaded_activity_exists | ||
@colin = build(:claims_support_user, :colin) | ||
|
||
@best_practice_network = build(:claims_provider, name: "Best Practice Network") | ||
@best_practice_network_claim = build(:claim, :payment_in_progress, submitted_at: 1.day.ago, reference: "12345678", provider: @best_practice_network) | ||
|
||
@niot = build(:claims_provider, name: "National Institute of Technology") | ||
@niot_claim = build(:claim, :payment_in_progress, submitted_at: 1.day.ago, reference: "87654321", provider: @niot) | ||
|
||
@clawback = build(:clawback, claims: [@best_practice_network_claim, @niot_claim]) | ||
@activity_log = create(:claim_activity, :clawback_response_uploaded, user: @colin, record: @clawback) | ||
end | ||
|
||
def and_i_am_signed_in | ||
sign_in_claims_support_user | ||
end | ||
|
||
def then_i_see_the_organisations_page | ||
expect(page).to have_title("Organisations (2) - Claim funding for mentor training - GOV.UK") | ||
expect(page).to have_h1("Organisations (2)") | ||
end | ||
|
||
def when_i_click_on_claims | ||
click_on("Claims") | ||
end | ||
|
||
def then_i_see_the_claims_page | ||
expect(page).to have_title("Claims - Claim funding for mentor training - GOV.UK") | ||
expect(primary_navigation).to have_current_item("Claims") | ||
expect(page).to have_h1("Claims") | ||
expect(secondary_navigation).to have_current_item("All claims") | ||
end | ||
|
||
def when_i_click_on_activity_log | ||
click_on("Activity log") | ||
end | ||
|
||
def then_i_see_the_activity_log_page | ||
expect(page).to have_title("Claims - Claim funding for mentor training - GOV.UK") | ||
expect(primary_navigation).to have_current_item("Claims") | ||
expect(page).to have_h1("Claims") | ||
expect(secondary_navigation).to have_current_item("Activity log") | ||
expect(page).to have_h2("Activity log") | ||
expect(page).to have_element("h3", class: "app-timeline__title", text: "Payer clawback response uploaded") | ||
expect(page).to have_link("View details", href: claims_support_claims_claim_activity_path(@activity_log)) | ||
end | ||
|
||
def when_i_click_on_view_details | ||
click_on("View details") | ||
end | ||
|
||
def then_i_see_the_activity_details | ||
expect(page).to have_title("Payer clawback response uploaded - Claim funding for mentor training - GOV.UK") | ||
expect(primary_navigation).to have_current_item("Claims") | ||
expect(page).to have_h1("Payer clawback response uploaded") | ||
expect(page).to have_link("12345678", href: claims_support_claim_path(@best_practice_network_claim)) | ||
expect(page).to have_h2("Providers") | ||
expect(page).to have_h3("Best Practice Network") | ||
expect(page).to have_table_row({ | ||
"Claim reference" => "12345678", | ||
"Number of mentors" => "0", | ||
"Claim amount" => "£#{@best_practice_network_claim.amount}", | ||
}) | ||
|
||
expect(page).to have_h3("National Institute of Technology") | ||
expect(page).to have_table_row({ | ||
"Claim reference" => "87654321", | ||
"Number of mentors" => "0", | ||
"Claim amount" => "£#{@niot_claim.amount}", | ||
}) | ||
end | ||
|
||
def when_i_click_on_download_csv | ||
click_on "Download CSV" | ||
end | ||
|
||
def then_i_receive_a_csv_file | ||
expect(page.response_headers["Content-Type"]).to eq("text/csv") | ||
expect(page.response_headers["Content-Disposition"]).to eq("attachment; filename=\"example-clawbacks.csv\"; filename*=UTF-8''example-clawbacks.csv") | ||
end | ||
end |
Oops, something went wrong.