-
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.
Add manual workflow buttons to payments flow
- Loading branch information
1 parent
d516027
commit c674e50
Showing
11 changed files
with
306 additions
and
2 deletions.
There are no files selected for viewing
25 changes: 24 additions & 1 deletion
25
app/controllers/claims/support/claims/payments/claims_controller.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
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
21 changes: 21 additions & 0 deletions
21
app/views/claims/support/claims/payments/claims/confirm_information_sent.html.erb
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,21 @@ | ||
<%= render "claims/support/primary_navigation", current: :claims %> | ||
<% content_for(:page_title) { sanitize t(".page_title") } %> | ||
|
||
<% content_for(:before_content) do %> | ||
<%= govuk_back_link href: claims_support_claims_payments_path %> | ||
<% end %> | ||
|
||
<div class="govuk-width-container"> | ||
<div class="govuk-grid-row"> | ||
<div class="govuk-grid-column-two-thirds"> | ||
<p class="govuk-caption-l"><%= t(".page_caption", reference: @claim.reference) %></p> | ||
<h1 class="govuk-heading-l"><%= t(".page_title") %></h1> | ||
|
||
<p class="govuk-body"><%= t(".description") %></p> | ||
|
||
<%= govuk_button_to t(".submit"), information_sent_claims_support_claims_payments_claim_path(@claim), method: :put %> | ||
|
||
<p class="govuk-body"><%= govuk_link_to t(".cancel"), claims_support_claims_payments_path %></p> | ||
</div> | ||
</div> | ||
</div> |
21 changes: 21 additions & 0 deletions
21
app/views/claims/support/claims/payments/claims/confirm_paid.html.erb
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,21 @@ | ||
<%= render "claims/support/primary_navigation", current: :claims %> | ||
<% content_for(:page_title) { sanitize t(".page_title") } %> | ||
|
||
<% content_for(:before_content) do %> | ||
<%= govuk_back_link href: claims_support_claims_payments_path %> | ||
<% end %> | ||
|
||
<div class="govuk-width-container"> | ||
<div class="govuk-grid-row"> | ||
<div class="govuk-grid-column-two-thirds"> | ||
<p class="govuk-caption-l"><%= t(".page_caption", reference: @claim.reference) %></p> | ||
<h1 class="govuk-heading-l"><%= t(".page_title") %></h1> | ||
|
||
<p class="govuk-body"><%= t(".description") %></p> | ||
|
||
<%= govuk_button_to t(".submit"), paid_claims_support_claims_payments_claim_path(@claim), method: :put %> | ||
|
||
<p class="govuk-body"><%= govuk_link_to t(".cancel"), claims_support_claims_payments_path %></p> | ||
</div> | ||
</div> | ||
</div> |
21 changes: 21 additions & 0 deletions
21
app/views/claims/support/claims/payments/claims/confirm_reject.html.erb
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,21 @@ | ||
<%= render "claims/support/primary_navigation", current: :claims %> | ||
<% content_for(:page_title) { sanitize t(".page_title") } %> | ||
|
||
<% content_for(:before_content) do %> | ||
<%= govuk_back_link href: claims_support_claims_payments_path %> | ||
<% end %> | ||
|
||
<div class="govuk-width-container"> | ||
<div class="govuk-grid-row"> | ||
<div class="govuk-grid-column-two-thirds"> | ||
<p class="govuk-caption-l"><%= t(".page_caption", reference: @claim.reference) %></p> | ||
<h1 class="govuk-heading-l"><%= t(".page_title") %></h1> | ||
|
||
<p class="govuk-body"><%= t(".description") %></p> | ||
|
||
<%= govuk_button_to t(".submit"), reject_claims_support_claims_payments_claim_path(@claim), method: :put %> | ||
|
||
<p class="govuk-body"><%= govuk_link_to t(".cancel"), claims_support_claims_payments_path %></p> | ||
</div> | ||
</div> | ||
</div> |
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
47 changes: 47 additions & 0 deletions
47
spec/system/claims/support/claims/payments/confirm_claim_payment_information_sent_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,47 @@ | ||
require "rails_helper" | ||
|
||
RSpec.describe "Confirm claim payment information sent", service: :claims, type: :system do | ||
let(:support_user) { create(:claims_support_user) } | ||
|
||
let!(:claim) { create(:claim, :payment_information_requested) } | ||
|
||
scenario "Support user confirms claim payment information sent" do | ||
given_i_sign_in_as(support_user) | ||
|
||
given_i_visit_a_claim_show_page(claim) | ||
when_i_click_on_confirm_information_sent | ||
then_i_see_a_confirmation_page | ||
|
||
when_i_click_on_update_claim | ||
then_i_see_the_claim_updated | ||
end | ||
|
||
private | ||
|
||
def given_i_visit_a_claim_show_page(claim) | ||
click_on("Claims") | ||
click_on("Payments") | ||
click_on(claim.school_name) | ||
end | ||
|
||
def when_i_click_on_confirm_information_sent | ||
click_on("Confirm information sent") | ||
end | ||
|
||
def then_i_see_a_confirmation_page | ||
expect(page).to have_content("Are you sure you want to update the claim?") | ||
expect(page).to have_content("You confirm that you have sent the ESFA the information they requested so they can pay the claim.") | ||
end | ||
|
||
def when_i_click_on_update_claim | ||
click_on("Update claim") | ||
end | ||
|
||
def then_i_see_the_claim_updated | ||
expect(page).to have_content("Claim updated") | ||
|
||
within("h1.govuk-heading-l .govuk-tag") do | ||
expect(page).to have_content("Information sent") | ||
end | ||
end | ||
end |
47 changes: 47 additions & 0 deletions
47
spec/system/claims/support/claims/payments/confirm_claim_payment_paid_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,47 @@ | ||
require "rails_helper" | ||
|
||
RSpec.describe "Confirm claim payment paid", service: :claims, type: :system do | ||
let(:support_user) { create(:claims_support_user) } | ||
|
||
let!(:claim) { create(:claim, :payment_information_sent) } | ||
|
||
scenario "Support user confirms claim payment paid" do | ||
given_i_sign_in_as(support_user) | ||
|
||
given_i_visit_a_claim_show_page(claim) | ||
when_i_click_on_confirm_paid | ||
then_i_see_a_confirmation_page | ||
|
||
when_i_click_on_update_claim | ||
then_i_see_the_claim_updated | ||
end | ||
|
||
private | ||
|
||
def given_i_visit_a_claim_show_page(claim) | ||
click_on("Claims") | ||
click_on("Payments") | ||
click_on(claim.school_name) | ||
end | ||
|
||
def when_i_click_on_confirm_paid | ||
click_on("Confirm claim paid") | ||
end | ||
|
||
def then_i_see_a_confirmation_page | ||
expect(page).to have_content("Are you sure you want to update the claim?") | ||
expect(page).to have_content("This will mark the claim as ‘Paid’.") | ||
end | ||
|
||
def when_i_click_on_update_claim | ||
click_on("Update claim") | ||
end | ||
|
||
def then_i_see_the_claim_updated | ||
expect(page).to have_content("Claim updated") | ||
|
||
within("h1.govuk-heading-l .govuk-tag") do | ||
expect(page).to have_content("Paid") | ||
end | ||
end | ||
end |
47 changes: 47 additions & 0 deletions
47
spec/system/claims/support/claims/payments/reject_claim_payment_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,47 @@ | ||
require "rails_helper" | ||
|
||
RSpec.describe "Reject claim payment", service: :claims, type: :system do | ||
let(:support_user) { create(:claims_support_user) } | ||
|
||
let!(:claim) { create(:claim, :payment_information_sent) } | ||
|
||
scenario "Support user rejects claim payment" do | ||
given_i_sign_in_as(support_user) | ||
|
||
given_i_visit_a_claim_show_page(claim) | ||
when_i_click_on_reject | ||
then_i_see_a_confirmation_page | ||
|
||
when_i_click_on_reject_claim | ||
then_i_see_the_claim_rejected | ||
end | ||
|
||
private | ||
|
||
def given_i_visit_a_claim_show_page(claim) | ||
click_on("Claims") | ||
click_on("Payments") | ||
click_on(claim.school_name) | ||
end | ||
|
||
def when_i_click_on_reject | ||
click_on("Reject claim") | ||
end | ||
|
||
def then_i_see_a_confirmation_page | ||
expect(page).to have_content("Are you sure you want to reject the claim?") | ||
expect(page).to have_content("This will result in this claim not being paid.") | ||
end | ||
|
||
def when_i_click_on_reject_claim | ||
click_on("Reject claim") | ||
end | ||
|
||
def then_i_see_the_claim_rejected | ||
expect(page).to have_content("Claim rejected") | ||
|
||
within("h1.govuk-heading-l .govuk-tag") do | ||
expect(page).to have_content("Payment not approved") | ||
end | ||
end | ||
end |