Skip to content

Commit

Permalink
Amend show and index route for sampling claims
Browse files Browse the repository at this point in the history
  • Loading branch information
dp-daly committed Dec 18, 2024
1 parent bc92b53 commit 6d06fde
Show file tree
Hide file tree
Showing 19 changed files with 34 additions and 34 deletions.
2 changes: 1 addition & 1 deletion config/routes/claims.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
end

resources :payments, only: %i[index]
resources :samplings, path: "sampling", only: %i[index show] do
resources :samplings, path: "sampling/claims", only: %i[index show] do
member do
get :confirm_approval
put :update
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def then_i_see_the_sampling_reason
expect(page).to have_element(:p, text: "Randomly selected for audit", class: "govuk-body")
end

expect(page).to have_link("Approve claim", href: "/support/claims/sampling/#{@sampling_claim.id}/confirm_approval")
expect(page).to have_link("Approve claim", href: "/support/claims/sampling/claims/#{@sampling_claim.id}/confirm_approval")
end

def when_i_click_on_approve_claim
Expand All @@ -131,7 +131,7 @@ def then_i_see_the_confirm_approval_page
expect(page).to have_h1("Are you sure you want to approve the claim?")
expect(page).to have_element(:p, text: "This will mark the claim as 'Paid'.", class: "govuk-body")
expect(page).to have_button("Approve claim")
expect(page).to have_link("Cancel", href: "/support/claims/sampling/#{@sampling_claim.id}")
expect(page).to have_link("Cancel", href: "/support/claims/sampling/claims/#{@sampling_claim.id}")
end

def when_i_click_on_cancel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def i_see_the_sampling_index_page
def and_i_see_the_sampled_claim_for_the_current_academic_year
expect(page).to have_claim_card({
"title" => "#{@current_claim.reference} - #{@current_claim.school.name}",
"url" => "/support/claims/sampling/#{@current_claim.id}",
"url" => "/support/claims/sampling/claims/#{@current_claim.id}",
"status" => "Sampling in progress",
"academic_year" => @current_claim.academic_year.name,
"provider_name" => @current_claim.provider.name,
Expand All @@ -135,7 +135,7 @@ def and_i_see_the_sampled_claim_for_the_current_academic_year
def and_i_see_the_sampled_claim_for_the_previous_academic_year
expect(page).to have_claim_card({
"title" => "#{@previous_claim.reference} - #{@previous_claim.school.name}",
"url" => "/support/claims/sampling/#{@previous_claim.id}",
"url" => "/support/claims/sampling/claims/#{@previous_claim.id}",
"status" => "Sampling in progress",
"academic_year" => @previous_claim.academic_year.name,
"provider_name" => @previous_claim.provider.name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def i_see_the_sampling_index_page
def and_i_see_the_sampled_claim_for_provider_niot
expect(page).to have_claim_card({
"title" => "#{@niot_claim.reference} - #{@niot_claim.school.name}",
"url" => "/support/claims/sampling/#{@niot_claim.id}",
"url" => "/support/claims/sampling/claims/#{@niot_claim.id}",
"status" => "Sampling in progress",
"academic_year" => @niot_claim.academic_year.name,
"provider_name" => @niot_claim.provider.name,
Expand All @@ -123,7 +123,7 @@ def and_i_see_the_sampled_claim_for_provider_niot
def and_i_see_the_sampled_claim_for_provider_bpn
expect(page).to have_claim_card({
"title" => "#{@bpn_claim.reference} - #{@bpn_claim.school.name}",
"url" => "/support/claims/sampling/#{@bpn_claim.id}",
"url" => "/support/claims/sampling/claims/#{@bpn_claim.id}",
"status" => "Sampling in progress",
"academic_year" => @bpn_claim.academic_year.name,
"provider_name" => @bpn_claim.provider.name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def i_see_the_sampling_index_page
def and_i_see_the_sampled_claim_for_springfield_elementary
expect(page).to have_claim_card({
"title" => "#{@springfield_claim.reference} - #{@springfield_claim.school.name}",
"url" => "/support/claims/sampling/#{@springfield_claim.id}",
"url" => "/support/claims/sampling/claims/#{@springfield_claim.id}",
"status" => "Sampling in progress",
"academic_year" => @springfield_claim.academic_year.name,
"provider_name" => @springfield_claim.provider.name,
Expand All @@ -123,7 +123,7 @@ def and_i_see_the_sampled_claim_for_springfield_elementary
def and_i_see_the_sampled_claim_for_hogwarts
expect(page).to have_claim_card({
"title" => "#{@hogwarts_claim.reference} - #{@hogwarts_claim.school.name}",
"url" => "/support/claims/sampling/#{@hogwarts_claim.id}",
"url" => "/support/claims/sampling/claims/#{@hogwarts_claim.id}",
"status" => "Sampling in progress",
"academic_year" => @hogwarts_claim.academic_year.name,
"provider_name" => @hogwarts_claim.provider.name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def i_see_the_sampling_index_page
def and_i_see_claims_with_a_sampling_in_progress_status
expect(page).to have_claim_card({
"title" => "#{@sampling_in_progress_claim.reference} - #{@sampling_in_progress_claim.school.name}",
"url" => "/support/claims/sampling/#{@sampling_in_progress_claim.id}",
"url" => "/support/claims/sampling/claims/#{@sampling_in_progress_claim.id}",
"status" => "Sampling in progress",
"academic_year" => @sampling_in_progress_claim.academic_year.name,
"provider_name" => @sampling_in_progress_claim.provider.name,
Expand All @@ -114,7 +114,7 @@ def and_i_see_claims_with_a_sampling_in_progress_status
def and_i_see_claims_with_a_sampling_provider_not_approved_status
expect(page).to have_claim_card({
"title" => "#{@sampling_provider_not_approved_claim.reference} - #{@sampling_provider_not_approved_claim.school.name}",
"url" => "/support/claims/sampling/#{@sampling_provider_not_approved_claim.id}",
"url" => "/support/claims/sampling/claims/#{@sampling_provider_not_approved_claim.id}",
"status" => "Sampling in progress",
"academic_year" => @sampling_provider_not_approved_claim.academic_year.name,
"provider_name" => @sampling_provider_not_approved_claim.provider.name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def i_see_the_sampling_index_page
def and_i_see_the_sampled_claim_submitted_in_may
expect(page).to have_claim_card({
"title" => "#{@may_claim.reference} - #{@may_claim.school.name}",
"url" => "/support/claims/sampling/#{@may_claim.id}",
"url" => "/support/claims/sampling/claims/#{@may_claim.id}",
"status" => "Sampling in progress",
"academic_year" => @may_claim.academic_year.name,
"provider_name" => @may_claim.provider.name,
Expand All @@ -99,7 +99,7 @@ def and_i_see_the_sampled_claim_submitted_in_may
def and_i_see_the_sampled_claim_submitted_in_july
expect(page).to have_claim_card({
"title" => "#{@july_claim.reference} - #{@july_claim.school.name}",
"url" => "/support/claims/sampling/#{@july_claim.id}",
"url" => "/support/claims/sampling/claims/#{@july_claim.id}",
"status" => "Sampling in progress",
"academic_year" => @july_claim.academic_year.name,
"provider_name" => @july_claim.provider.name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def i_see_the_sampling_index_page
def and_i_see_the_sampled_claim_submitted_in_may
expect(page).to have_claim_card({
"title" => "#{@may_claim.reference} - #{@may_claim.school.name}",
"url" => "/support/claims/sampling/#{@may_claim.id}",
"url" => "/support/claims/sampling/claims/#{@may_claim.id}",
"status" => "Sampling in progress",
"academic_year" => @may_claim.academic_year.name,
"provider_name" => @may_claim.provider.name,
Expand All @@ -99,7 +99,7 @@ def and_i_see_the_sampled_claim_submitted_in_may
def and_i_see_the_sampled_claim_submitted_in_july
expect(page).to have_claim_card({
"title" => "#{@july_claim.reference} - #{@july_claim.school.name}",
"url" => "/support/claims/sampling/#{@july_claim.id}",
"url" => "/support/claims/sampling/claims/#{@july_claim.id}",
"status" => "Sampling in progress",
"academic_year" => @july_claim.academic_year.name,
"provider_name" => @july_claim.provider.name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def i_see_the_sampling_index_page
def and_i_see_the_sampled_claim_with_reference_11111111
expect(page).to have_claim_card({
"title" => "#{@claim_11111111.reference} - #{@claim_11111111.school.name}",
"url" => "/support/claims/sampling/#{@claim_11111111.id}",
"url" => "/support/claims/sampling/claims/#{@claim_11111111.id}",
"status" => "Sampling in progress",
"academic_year" => @claim_11111111.academic_year.name,
"provider_name" => @claim_11111111.provider.name,
Expand All @@ -97,7 +97,7 @@ def and_i_see_the_sampled_claim_with_reference_11111111
def and_i_see_the_sampled_claim_with_reference_22222222
expect(page).to have_claim_card({
"title" => "#{@claim_22222222.reference} - #{@claim_22222222.school.name}",
"url" => "/support/claims/sampling/#{@claim_22222222.id}",
"url" => "/support/claims/sampling/claims/#{@claim_22222222.id}",
"status" => "Sampling in progress",
"academic_year" => @claim_22222222.academic_year.name,
"provider_name" => @claim_22222222.provider.name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def then_i_see_the_claims_sampling_claims_index_page
def and_i_see_claims_with_a_sampling_in_progress_status
expect(page).to have_claim_card({
"title" => "#{@sampling_in_progress_claim.reference} - #{@sampling_in_progress_claim.school.name}",
"url" => "/support/claims/sampling/#{@sampling_in_progress_claim.id}",
"url" => "/support/claims/sampling/claims/#{@sampling_in_progress_claim.id}",
"status" => "Sampling in progress",
"academic_year" => @sampling_in_progress_claim.academic_year.name,
"provider_name" => @sampling_in_progress_claim.provider.name,
Expand All @@ -80,7 +80,7 @@ def and_i_see_claims_with_a_sampling_in_progress_status
def and_i_see_claims_with_a_sampling_provider_not_approved_status
expect(page).to have_claim_card({
"title" => "#{@sampling_provider_not_approved_claim.reference} - #{@sampling_provider_not_approved_claim.school.name}",
"url" => "/support/claims/sampling/#{@sampling_provider_not_approved_claim.id}",
"url" => "/support/claims/sampling/claims/#{@sampling_provider_not_approved_claim.id}",
"status" => "Sampling in progress",
"academic_year" => @sampling_provider_not_approved_claim.academic_year.name,
"provider_name" => @sampling_provider_not_approved_claim.provider.name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def then_i_see_the_upload_has_been_successful
expect(page).to have_h2("Sampling (1)")
expect(page).to have_claim_card({
"title" => "#{@current_claim.reference} - #{@current_claim.school.name}",
"url" => "/support/claims/sampling/#{@current_claim.id}",
"url" => "/support/claims/sampling/claims/#{@current_claim.id}",
"status" => "Sampling in progress",
"academic_year" => @current_claim.academic_year.name,
"provider_name" => @current_claim.provider.name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def and_i_see_a_claim_with_the_status_sampling_in_progress
expect(page).to have_h2("Sampling (1)")
expect(page).to have_claim_card({
"title" => "11111111 - #{@claim.school_name}",
"url" => "/support/claims/sampling/#{@claim.id}",
"url" => "/support/claims/sampling/claims/#{@claim.id}",
"status" => "Sampling in progress",
"academic_year" => @claim.academic_year.name,
"provider_name" => @claim.provider.name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def and_i_see_a_claim_with_the_status_sampling_in_progress
expect(page).to have_h2("Sampling (1)")
expect(page).to have_claim_card({
"title" => "11111111 - #{@sampling_in_progress_claim.school_name}",
"url" => "/support/claims/sampling/#{@sampling_in_progress_claim.id}",
"url" => "/support/claims/sampling/claims/#{@sampling_in_progress_claim.id}",
"status" => "Sampling in progress",
"academic_year" => @sampling_in_progress_claim.academic_year.name,
"provider_name" => @sampling_in_progress_claim.provider.name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def and_i_see_two_claims_with_the_status_sampling_in_progress
expect(page).to have_h2("Sampling (2)")
expect(page).to have_claim_card({
"title" => "33333333 - #{@sampling_in_progress_claim_1.school_name}",
"url" => "/support/claims/sampling/#{@sampling_in_progress_claim_1.id}",
"url" => "/support/claims/sampling/claims/#{@sampling_in_progress_claim_1.id}",
"status" => "Sampling in progress",
"academic_year" => @sampling_in_progress_claim_1.academic_year.name,
"provider_name" => @sampling_in_progress_claim_1.provider.name,
Expand All @@ -91,7 +91,7 @@ def and_i_see_two_claims_with_the_status_sampling_in_progress
})
expect(page).to have_claim_card({
"title" => "22222222 - #{@sampling_in_progress_claim_2.school_name}",
"url" => "/support/claims/sampling/#{@sampling_in_progress_claim_2.id}",
"url" => "/support/claims/sampling/claims/#{@sampling_in_progress_claim_2.id}",
"status" => "Sampling in progress",
"academic_year" => @sampling_in_progress_claim_2.academic_year.name,
"provider_name" => @sampling_in_progress_claim_2.provider.name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def and_i_see_two_claims_with_the_status_sampling_in_progress
expect(page).to have_h2("Sampling (2)")
expect(page).to have_claim_card({
"title" => "11111111 - #{@sampling_in_progress_claim_1.school_name}",
"url" => "/support/claims/sampling/#{@sampling_in_progress_claim_1.id}",
"url" => "/support/claims/sampling/claims/#{@sampling_in_progress_claim_1.id}",
"status" => "Sampling in progress",
"academic_year" => @sampling_in_progress_claim_1.academic_year.name,
"provider_name" => @sampling_in_progress_claim_1.provider.name,
Expand All @@ -91,7 +91,7 @@ def and_i_see_two_claims_with_the_status_sampling_in_progress
})
expect(page).to have_claim_card({
"title" => "22222222 - #{@sampling_in_progress_claim_2.school_name}",
"url" => "/support/claims/sampling/#{@sampling_in_progress_claim_2.id}",
"url" => "/support/claims/sampling/claims/#{@sampling_in_progress_claim_2.id}",
"status" => "Sampling in progress",
"academic_year" => @sampling_in_progress_claim_2.academic_year.name,
"provider_name" => @sampling_in_progress_claim_2.provider.name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def and_i_see_two_claims_with_the_status_sampling_in_progress
expect(page).to have_h2("Sampling (2)")
expect(page).to have_claim_card({
"title" => "11111111 - #{@sampling_in_progress_claim_1.school_name}",
"url" => "/support/claims/sampling/#{@sampling_in_progress_claim_1.id}",
"url" => "/support/claims/sampling/claims/#{@sampling_in_progress_claim_1.id}",
"status" => "Sampling in progress",
"academic_year" => @sampling_in_progress_claim_1.academic_year.name,
"provider_name" => @sampling_in_progress_claim_1.provider.name,
Expand All @@ -98,7 +98,7 @@ def and_i_see_two_claims_with_the_status_sampling_in_progress
})
expect(page).to have_claim_card({
"title" => "22222222 - #{@sampling_in_progress_claim_2.school_name}",
"url" => "/support/claims/sampling/#{@sampling_in_progress_claim_2.id}",
"url" => "/support/claims/sampling/claims/#{@sampling_in_progress_claim_2.id}",
"status" => "Sampling in progress",
"academic_year" => @sampling_in_progress_claim_2.academic_year.name,
"provider_name" => @sampling_in_progress_claim_2.provider.name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def and_i_see_two_claims_with_the_status_sampling_in_progress
expect(page).to have_h2("Sampling (2)")
expect(page).to have_claim_card({
"title" => "11111111 - #{@sampling_in_progress_claim_1.school_name}",
"url" => "/support/claims/sampling/#{@sampling_in_progress_claim_1.id}",
"url" => "/support/claims/sampling/claims/#{@sampling_in_progress_claim_1.id}",
"status" => "Sampling in progress",
"academic_year" => @sampling_in_progress_claim_1.academic_year.name,
"provider_name" => @sampling_in_progress_claim_1.provider.name,
Expand All @@ -91,7 +91,7 @@ def and_i_see_two_claims_with_the_status_sampling_in_progress
})
expect(page).to have_claim_card({
"title" => "22222222 - #{@sampling_in_progress_claim_2.school_name}",
"url" => "/support/claims/sampling/#{@sampling_in_progress_claim_2.id}",
"url" => "/support/claims/sampling/claims/#{@sampling_in_progress_claim_2.id}",
"status" => "Sampling in progress",
"academic_year" => @sampling_in_progress_claim_2.academic_year.name,
"provider_name" => @sampling_in_progress_claim_2.provider.name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def and_i_see_two_claims_with_the_status_sampling_in_progress
expect(page).to have_h2("Sampling (2)")
expect(page).to have_claim_card({
"title" => "11111111 - #{@sampling_in_progress_claim_1.school_name}",
"url" => "/support/claims/sampling/#{@sampling_in_progress_claim_1.id}",
"url" => "/support/claims/sampling/claims/#{@sampling_in_progress_claim_1.id}",
"status" => "Sampling in progress",
"academic_year" => @sampling_in_progress_claim_1.academic_year.name,
"provider_name" => @sampling_in_progress_claim_1.provider.name,
Expand All @@ -128,7 +128,7 @@ def and_i_see_two_claims_with_the_status_sampling_in_progress
})
expect(page).to have_claim_card({
"title" => "22222222 - #{@sampling_in_progress_claim_2.school_name}",
"url" => "/support/claims/sampling/#{@sampling_in_progress_claim_2.id}",
"url" => "/support/claims/sampling/claims/#{@sampling_in_progress_claim_2.id}",
"status" => "Sampling in progress",
"academic_year" => @sampling_in_progress_claim_2.academic_year.name,
"provider_name" => @sampling_in_progress_claim_2.provider.name,
Expand Down Expand Up @@ -182,7 +182,7 @@ def then_i_see_the_upload_has_been_successful
def then_i_can_see_claim_11111111_has_the_status_provider_not_approved
expect(page).to have_claim_card({
"title" => "11111111 - #{@sampling_in_progress_claim_1.school_name}",
"url" => "/support/claims/sampling/#{@sampling_in_progress_claim_1.id}",
"url" => "/support/claims/sampling/claims/#{@sampling_in_progress_claim_1.id}",
"status" => "Provider not approved",
"academic_year" => @sampling_in_progress_claim_1.academic_year.name,
"provider_name" => @sampling_in_progress_claim_1.provider.name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def and_i_see_a_claim_with_the_status_sampling_in_progress
expect(page).to have_h2("Sampling (1)")
expect(page).to have_claim_card({
"title" => "11111111 - #{@claim.school_name}",
"url" => "/support/claims/sampling/#{@claim.id}",
"url" => "/support/claims/sampling/claims/#{@claim.id}",
"status" => "Sampling in progress",
"academic_year" => @claim.academic_year.name,
"provider_name" => @claim.provider.name,
Expand Down

0 comments on commit 6d06fde

Please sign in to comment.