From aef4b1d003abe2da54165cc9eb03e77482540469 Mon Sep 17 00:00:00 2001
From: Ben Abraham <16797406+Kizr@users.noreply.github.com>
Date: Tue, 11 Feb 2025 14:51:13 +0000
Subject: [PATCH 1/2] Remove confirmation screen for school rejection journey
---
.../_confirmation_step.html.erb | 16 --------
app/wizards/claims/reject_claim_wizard.rb | 1 -
.../reject_claim_wizard/confirmation_step.rb | 3 --
...son_the_school_rejected_the_mentor_spec.rb | 32 ---------------
...why_the_school_rejected_the_mentor_spec.rb | 31 ---------------
...t_user_marks_the_claim_as_rejected_spec.rb | 39 +------------------
.../confirmation_step_spec.rb | 17 --------
.../claims/reject_claim_wizard_spec.rb | 5 +--
8 files changed, 3 insertions(+), 141 deletions(-)
delete mode 100644 app/views/wizards/claims/reject_claim_wizard/_confirmation_step.html.erb
delete mode 100644 app/wizards/claims/reject_claim_wizard/confirmation_step.rb
delete mode 100644 spec/wizards/claims/reject_claim_wizard/confirmation_step_spec.rb
diff --git a/app/views/wizards/claims/reject_claim_wizard/_confirmation_step.html.erb b/app/views/wizards/claims/reject_claim_wizard/_confirmation_step.html.erb
deleted file mode 100644
index 16c36bc0e..000000000
--- a/app/views/wizards/claims/reject_claim_wizard/_confirmation_step.html.erb
+++ /dev/null
@@ -1,16 +0,0 @@
-<%= content_for :page_title, sanitize(t(".page_title", reference: current_step.claim.reference)) %>
-
-<%= form_for(current_step, url: current_step_path, method: :put) do |f| %>
- <%= f.govuk_error_summary %>
-
-
-
-
<%= t(".caption", reference: current_step.claim.reference) %>
-
<%= t(".title") %>
-
-
<%= t(".checklist_html") %>
-
- <%= f.govuk_submit t(".continue") %>
-
-
-<% end %>
diff --git a/app/wizards/claims/reject_claim_wizard.rb b/app/wizards/claims/reject_claim_wizard.rb
index fce9899b6..51fee69b3 100644
--- a/app/wizards/claims/reject_claim_wizard.rb
+++ b/app/wizards/claims/reject_claim_wizard.rb
@@ -9,7 +9,6 @@ def initialize(claim:, current_user:, params:, state:, current_step: nil)
end
def define_steps
- add_step(ConfirmationStep)
not_assured_mentor_trainings.each do |mentor_training|
add_step(SchoolResponseStep,
{ mentor_training_id: mentor_training.id },
diff --git a/app/wizards/claims/reject_claim_wizard/confirmation_step.rb b/app/wizards/claims/reject_claim_wizard/confirmation_step.rb
deleted file mode 100644
index be6e96cae..000000000
--- a/app/wizards/claims/reject_claim_wizard/confirmation_step.rb
+++ /dev/null
@@ -1,3 +0,0 @@
-class Claims::RejectClaimWizard::ConfirmationStep < BaseStep
- delegate :claim, to: :wizard
-end
diff --git a/spec/system/claims/support/claims/sampling/mark_claim_as_rejected/support_user_changes_the_reason_the_school_rejected_the_mentor_spec.rb b/spec/system/claims/support/claims/sampling/mark_claim_as_rejected/support_user_changes_the_reason_the_school_rejected_the_mentor_spec.rb
index 1225b72af..dd71efacb 100644
--- a/spec/system/claims/support/claims/sampling/mark_claim_as_rejected/support_user_changes_the_reason_the_school_rejected_the_mentor_spec.rb
+++ b/spec/system/claims/support/claims/sampling/mark_claim_as_rejected/support_user_changes_the_reason_the_school_rejected_the_mentor_spec.rb
@@ -12,9 +12,6 @@
then_i_see_the_details_of_the_claim
when_i_click_on_reject_claim
- then_i_see_the_confirmation_page
-
- when_i_click_on_continue
then_i_see_the_rejection_reason_page_for_john_smith
when_i_enter_a_reason_why_the_school_rejected_john_smith
@@ -200,35 +197,6 @@ def when_i_enter_a_reason_why_the_school_rejected_john_smith
fill_in "Only include details related to John Smith", with: "School rejected John Smith"
end
- def then_i_see_the_confirmation_page
- expect(page).to have_title(
- "Are you sure you want to reject the claim? - Reject - Claim #{@claim.reference} - Auditing - Claims - Claim funding for mentor training - GOV.UK",
- )
- expect(page).to have_element(
- :span,
- text: "Reject - Claim #{@claim.reference}",
- class: "govuk-caption-l",
- )
- expect(page).to have_h1("Are you sure you want to reject the claim?")
- expect(page).to have_element(:p, text: "To reject this claim, you must have:")
- expect(page).to have_element(
- :li,
- text: "reviewed any evidence sent by the school and deemed it insufficient to prove the claim is legitimate",
- )
- expect(page).to have_element(
- :li,
- text: "received second approval from within the support team or policy team",
- )
- expect(page).to have_element(
- :li,
- text: "contacted the school to let them know their evidence has been rejected",
- )
- expect(page).to have_element(
- :li,
- text: "told the school which claims you are rejecting and how much will be clawed back",
- )
- end
-
def when_i_click_on_change_reason_for_rejection_for_john_smith
click_on "Change Reason for rejection for John Smith"
end
diff --git a/spec/system/claims/support/claims/sampling/mark_claim_as_rejected/support_user_does_not_enter_a_reason_why_the_school_rejected_the_mentor_spec.rb b/spec/system/claims/support/claims/sampling/mark_claim_as_rejected/support_user_does_not_enter_a_reason_why_the_school_rejected_the_mentor_spec.rb
index 03ff8091c..e88d1e5f5 100644
--- a/spec/system/claims/support/claims/sampling/mark_claim_as_rejected/support_user_does_not_enter_a_reason_why_the_school_rejected_the_mentor_spec.rb
+++ b/spec/system/claims/support/claims/sampling/mark_claim_as_rejected/support_user_does_not_enter_a_reason_why_the_school_rejected_the_mentor_spec.rb
@@ -14,9 +14,6 @@
then_i_see_the_details_of_the_claim
when_i_click_on_reject_claim
- then_i_see_the_confirmation_page
-
- when_i_click_on_continue
then_i_see_the_rejection_reason_page_for_john_smith
when_i_click_on_continue
@@ -106,32 +103,4 @@ def then_i_see_a_validation_error_for_entering_a_reason_with_john_smith_was_reje
expect(page).to have_validation_error("Enter the response the school has given for rejecting this mentor.")
end
- def then_i_see_the_confirmation_page
- expect(page).to have_title(
- "Are you sure you want to reject the claim? - Reject - Claim #{@claim.reference} - Auditing - Claims - Claim funding for mentor training - GOV.UK",
- )
- expect(page).to have_element(
- :span,
- text: "Reject - Claim #{@claim.reference}",
- class: "govuk-caption-l",
- )
- expect(page).to have_h1("Are you sure you want to reject the claim?")
- expect(page).to have_element(:p, text: "To reject this claim, you must have:")
- expect(page).to have_element(
- :li,
- text: "reviewed any evidence sent by the school and deemed it insufficient to prove the claim is legitimate",
- )
- expect(page).to have_element(
- :li,
- text: "received second approval from within the support team or policy team",
- )
- expect(page).to have_element(
- :li,
- text: "contacted the school to let them know their evidence has been rejected",
- )
- expect(page).to have_element(
- :li,
- text: "told the school which claims you are rejecting and how much will be clawed back",
- )
- end
end
diff --git a/spec/system/claims/support/claims/sampling/mark_claim_as_rejected/support_user_marks_the_claim_as_rejected_spec.rb b/spec/system/claims/support/claims/sampling/mark_claim_as_rejected/support_user_marks_the_claim_as_rejected_spec.rb
index 4355d7154..e366d3ae4 100644
--- a/spec/system/claims/support/claims/sampling/mark_claim_as_rejected/support_user_marks_the_claim_as_rejected_spec.rb
+++ b/spec/system/claims/support/claims/sampling/mark_claim_as_rejected/support_user_marks_the_claim_as_rejected_spec.rb
@@ -12,9 +12,6 @@
then_i_see_the_details_of_the_claim
when_i_click_on_reject_claim
- then_i_see_the_confirmation_page
-
- when_i_click_on_continue
then_i_see_the_rejection_reason_page_for_jane_doe
when_i_enter_a_reason_why_the_school_rejected_jane_doe
@@ -31,13 +28,12 @@
then_i_see_the_details_of_the_claim
when_i_click_on_reject_claim
- then_i_see_the_confirmation_page
+ then_i_see_the_rejection_reason_page_for_jane_doe
when_i_click_on_cancel
then_i_see_the_details_of_the_claim
when_i_click_on_reject_claim
- and_i_click_on_continue
and_i_enter_a_reason_why_the_school_rejected_jane_doe
and_i_click_on_continue
and_i_enter_a_reason_why_the_school_rejected_john_smith
@@ -54,14 +50,10 @@
then_i_see_the_rejection_reason_page_for_jane_doe
and_the_reason_why_the_school_rejected_jane_doe_is_prefilled
- when_i_click_on_back
- then_i_see_the_confirmation_page
-
when_i_click_on_back
then_i_see_the_details_of_the_claim
when_i_click_on_reject_claim
- and_i_click_on_continue
and_i_enter_a_reason_why_the_school_rejected_jane_doe
and_i_click_on_continue
and_i_enter_a_reason_why_the_school_rejected_john_smith
@@ -269,33 +261,4 @@ def when_i_enter_a_reason_why_the_school_rejected_jane_doe
end
alias_method :and_i_enter_a_reason_why_the_school_rejected_jane_doe,
:when_i_enter_a_reason_why_the_school_rejected_jane_doe
-
- def then_i_see_the_confirmation_page
- expect(page).to have_title(
- "Are you sure you want to reject the claim? - Reject - Claim #{@claim.reference} - Auditing - Claims - Claim funding for mentor training - GOV.UK",
- )
- expect(page).to have_element(
- :span,
- text: "Reject - Claim #{@claim.reference}",
- class: "govuk-caption-l",
- )
- expect(page).to have_h1("Are you sure you want to reject the claim?")
- expect(page).to have_element(:p, text: "To reject this claim, you must have:")
- expect(page).to have_element(
- :li,
- text: "reviewed any evidence sent by the school and deemed it insufficient to prove the claim is legitimate",
- )
- expect(page).to have_element(
- :li,
- text: "received second approval from within the support team or policy team",
- )
- expect(page).to have_element(
- :li,
- text: "contacted the school to let them know their evidence has been rejected",
- )
- expect(page).to have_element(
- :li,
- text: "told the school which claims you are rejecting and how much will be clawed back",
- )
- end
end
diff --git a/spec/wizards/claims/reject_claim_wizard/confirmation_step_spec.rb b/spec/wizards/claims/reject_claim_wizard/confirmation_step_spec.rb
deleted file mode 100644
index 2ffafd242..000000000
--- a/spec/wizards/claims/reject_claim_wizard/confirmation_step_spec.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-require "rails_helper"
-
-RSpec.describe Claims::RejectClaimWizard::ConfirmationStep, type: :model do
- subject(:step) { described_class.new(wizard: mock_wizard, attributes:) }
-
- let(:mock_wizard) do
- instance_double(Claims::RejectClaimWizard).tap do |mock_wizard|
- allow(mock_wizard).to receive_messages(claim: claim)
- end
- end
- let(:claim) { create(:claim) }
- let(:attributes) { nil }
-
- describe "delegations" do
- it { is_expected.to delegate_method(:claim).to(:wizard) }
- end
-end
diff --git a/spec/wizards/claims/reject_claim_wizard_spec.rb b/spec/wizards/claims/reject_claim_wizard_spec.rb
index 01a63d68a..0401b21b8 100644
--- a/spec/wizards/claims/reject_claim_wizard_spec.rb
+++ b/spec/wizards/claims/reject_claim_wizard_spec.rb
@@ -29,13 +29,13 @@
subject(:steps) { wizard.steps.keys }
context "when no mentors have been selected" do
- it { is_expected.to eq(%i[confirmation check_your_answers]) }
+ it { is_expected.to eq(%i[check_your_answers]) }
end
context "when the claim has mentor trainings which are assured" do
before { create(:mentor_training, claim:, mentor: mentor_jane_doe) }
- it { is_expected.to eq(%i[confirmation check_your_answers]) }
+ it { is_expected.to eq(%i[check_your_answers]) }
end
context "when the claim has not assured mentor trainings" do
@@ -46,7 +46,6 @@
it do
expect(steps).to contain_exactly(
- :confirmation,
"school_response_#{mentor_training_1.id}".to_sym,
"school_response_#{mentor_training_2.id}".to_sym,
:check_your_answers,
From c7b12e432afd5f6428e4069a865be5dc98aa92cf Mon Sep 17 00:00:00 2001
From: Ben Abraham <16797406+Kizr@users.noreply.github.com>
Date: Tue, 11 Feb 2025 16:42:55 +0000
Subject: [PATCH 2/2] Change caption and title to Provider rejection
---
.../_check_your_answers_step.html.erb | 2 ++
.../en/wizards/claims/reject_claim_wizard.yml | 22 +++++--------------
...son_the_school_rejected_the_mentor_spec.rb | 12 +++++-----
...why_the_school_rejected_the_mentor_spec.rb | 5 ++---
...t_user_marks_the_claim_as_rejected_spec.rb | 13 ++++++-----
5 files changed, 22 insertions(+), 32 deletions(-)
diff --git a/app/views/wizards/claims/reject_claim_wizard/_check_your_answers_step.html.erb b/app/views/wizards/claims/reject_claim_wizard/_check_your_answers_step.html.erb
index 440aeb2e7..00f4ef74a 100644
--- a/app/views/wizards/claims/reject_claim_wizard/_check_your_answers_step.html.erb
+++ b/app/views/wizards/claims/reject_claim_wizard/_check_your_answers_step.html.erb
@@ -8,6 +8,8 @@
<%= t(".caption", reference: current_step.claim.reference) %>
<%= t(".title") %>
+ <%= t(".information") %>
+
<% @wizard.not_assured_mentor_trainings.each_with_index do |mentor_training| %>
<%= t(".school_rejection_details", mentor_name: mentor_training.mentor_full_name) %>
diff --git a/config/locales/en/wizards/claims/reject_claim_wizard.yml b/config/locales/en/wizards/claims/reject_claim_wizard.yml
index c4d90d023..f5ed5ab10 100644
--- a/config/locales/en/wizards/claims/reject_claim_wizard.yml
+++ b/config/locales/en/wizards/claims/reject_claim_wizard.yml
@@ -2,23 +2,10 @@ en:
wizards:
claims:
reject_claim_wizard:
- confirmation_step:
- page_title: Are you sure you want to reject the claim? - Reject - Claim %{reference} - Auditing - Claims
- title: Are you sure you want to reject the claim?
- caption: Reject - Claim %{reference}
- continue: Continue
- checklist_html: |
-
To reject this claim, you must have:
-
- - reviewed any evidence sent by the school and deemed it insufficient to prove the claim is legitimate
- - received second approval from within the support team or policy team
- - contacted the school to let them know their evidence has been rejected
- - told the school which claims you are rejecting and how much will be clawed back
-
school_response_step:
- page_title: What is the schools response to the claim about %{mentor_name}? - Reject - Claim %{reference} - Auditing - Claims
+ page_title: What is the schools response to the claim about %{mentor_name}? - School rejection - Claim %{reference} - Auditing - Claims
title: What is the schools response to the claim about %{mentor_name}?
- caption: Reject - Claim %{reference}
+ caption: School rejection - Claim %{reference}
continue: Continue
hours_completed:
one: The school originally claimed %{mentor_name} has completed %{count} hour.
@@ -26,9 +13,9 @@ en:
please_add_reason: Only include details related to %{mentor_name}.
provider_response: Provider response
check_your_answers_step:
- page_title: Check your answers - Reject - Claim %{reference} - Auditing - Claims
+ page_title: Check your answers - School rejection - Claim %{reference} - Auditing - Claims
title: Check your answers
- caption: Reject - Claim %{reference}
+ caption: School rejection - Claim %{reference}
reason_for_rejection: Reason for rejection
school_rejection_details: Response to rejection for %{mentor_name}
provider_comments: Provider comments
@@ -40,3 +27,4 @@ en:
hours:
one: "%{count} hour"
other: "%{count} hours"
+ information: The information you have entered will inform the clawback process.
diff --git a/spec/system/claims/support/claims/sampling/mark_claim_as_rejected/support_user_changes_the_reason_the_school_rejected_the_mentor_spec.rb b/spec/system/claims/support/claims/sampling/mark_claim_as_rejected/support_user_changes_the_reason_the_school_rejected_the_mentor_spec.rb
index dd71efacb..3ef82f0bf 100644
--- a/spec/system/claims/support/claims/sampling/mark_claim_as_rejected/support_user_changes_the_reason_the_school_rejected_the_mentor_spec.rb
+++ b/spec/system/claims/support/claims/sampling/mark_claim_as_rejected/support_user_changes_the_reason_the_school_rejected_the_mentor_spec.rb
@@ -114,11 +114,11 @@ def when_i_enter_a_new_reason_why_the_school_rejected_john_smith
def then_i_see_the_check_your_answers_page
expect(page).to have_title(
- "Check your answers - Reject - Claim #{@claim.reference} - Auditing - Claims - Claim funding for mentor training - GOV.UK",
+ "Check your answers - School rejection - Claim #{@claim.reference} - Auditing - Claims - Claim funding for mentor training - GOV.UK",
)
expect(page).to have_element(
:span,
- text: "Reject - Claim #{@claim.reference}",
+ text: "School rejection - Claim #{@claim.reference}",
class: "govuk-caption-l",
)
expect(page).to have_h1("Check your answers")
@@ -155,11 +155,11 @@ def when_i_click_on_confirm_and_reject_claim
def then_i_see_the_rejection_reason_page_for_jane_doe
expect(page).to have_title(
- "What is the schools response to the claim about Jane Doe? - Reject - Claim #{@claim.reference} - Auditing - Claims - Claim funding for mentor training - GOV.UK",
+ "What is the schools response to the claim about Jane Doe? - School rejection - Claim #{@claim.reference} - Auditing - Claims - Claim funding for mentor training - GOV.UK",
)
expect(page).to have_element(
:span,
- text: "Reject - Claim #{@claim.reference}",
+ text: "School rejection - Claim #{@claim.reference}",
class: "govuk-caption-l",
)
expect(page).to have_h1("What is the schools response to the claim about Jane Doe?")
@@ -175,11 +175,11 @@ def then_i_see_the_rejection_reason_page_for_jane_doe
def then_i_see_the_rejection_reason_page_for_john_smith
expect(page).to have_title(
- "What is the schools response to the claim about John Smith? - Reject - Claim #{@claim.reference} - Auditing - Claims - Claim funding for mentor training - GOV.UK",
+ "What is the schools response to the claim about John Smith? - School rejection - Claim #{@claim.reference} - Auditing - Claims - Claim funding for mentor training - GOV.UK",
)
expect(page).to have_element(
:span,
- text: "Reject - Claim #{@claim.reference}",
+ text: "School rejection - Claim #{@claim.reference}",
class: "govuk-caption-l",
)
expect(page).to have_h1("What is the schools response to the claim about John Smith?")
diff --git a/spec/system/claims/support/claims/sampling/mark_claim_as_rejected/support_user_does_not_enter_a_reason_why_the_school_rejected_the_mentor_spec.rb b/spec/system/claims/support/claims/sampling/mark_claim_as_rejected/support_user_does_not_enter_a_reason_why_the_school_rejected_the_mentor_spec.rb
index e88d1e5f5..63f5d893e 100644
--- a/spec/system/claims/support/claims/sampling/mark_claim_as_rejected/support_user_does_not_enter_a_reason_why_the_school_rejected_the_mentor_spec.rb
+++ b/spec/system/claims/support/claims/sampling/mark_claim_as_rejected/support_user_does_not_enter_a_reason_why_the_school_rejected_the_mentor_spec.rb
@@ -81,11 +81,11 @@ def when_i_click_on_continue
def then_i_see_the_rejection_reason_page_for_john_smith
expect(page).to have_title(
- "What is the schools response to the claim about John Smith? - Reject - Claim #{@claim.reference} - Auditing - Claims - Claim funding for mentor training - GOV.UK",
+ "What is the schools response to the claim about John Smith? - School rejection - Claim #{@claim.reference} - Auditing - Claims - Claim funding for mentor training - GOV.UK",
)
expect(page).to have_element(
:span,
- text: "Reject - Claim #{@claim.reference}",
+ text: "School rejection - Claim #{@claim.reference}",
class: "govuk-caption-l",
)
expect(page).to have_h1("What is the schools response to the claim about John Smith?")
@@ -102,5 +102,4 @@ def then_i_see_the_rejection_reason_page_for_john_smith
def then_i_see_a_validation_error_for_entering_a_reason_with_john_smith_was_rejected_by_the_provider
expect(page).to have_validation_error("Enter the response the school has given for rejecting this mentor.")
end
-
end
diff --git a/spec/system/claims/support/claims/sampling/mark_claim_as_rejected/support_user_marks_the_claim_as_rejected_spec.rb b/spec/system/claims/support/claims/sampling/mark_claim_as_rejected/support_user_marks_the_claim_as_rejected_spec.rb
index e366d3ae4..f14c07e56 100644
--- a/spec/system/claims/support/claims/sampling/mark_claim_as_rejected/support_user_marks_the_claim_as_rejected_spec.rb
+++ b/spec/system/claims/support/claims/sampling/mark_claim_as_rejected/support_user_marks_the_claim_as_rejected_spec.rb
@@ -169,14 +169,15 @@ def when_i_enter_a_reason_why_the_school_rejected_john_smith
def then_i_see_the_check_your_answers_page
expect(page).to have_title(
- "Check your answers - Reject - Claim #{@claim.reference} - Auditing - Claims - Claim funding for mentor training - GOV.UK",
+ "Check your answers - School rejection - Claim #{@claim.reference} - Auditing - Claims - Claim funding for mentor training - GOV.UK",
)
expect(page).to have_element(
:span,
- text: "Reject - Claim #{@claim.reference}",
+ text: "School rejection - Claim #{@claim.reference}",
class: "govuk-caption-l",
)
expect(page).to have_h1("Check your answers")
+ expect(page).to have_element(:p, text: "The information you have entered will inform the clawback process.")
expect(page).to have_element(
:div,
text: "This will update the claim status to ‘rejected by school’ and move it to the clawback queue.",
@@ -218,11 +219,11 @@ def when_i_click_on_confirm_and_reject_claim
def then_i_see_the_rejection_reason_page_for_jane_doe
expect(page).to have_title(
- "What is the schools response to the claim about Jane Doe? - Reject - Claim #{@claim.reference} - Auditing - Claims - Claim funding for mentor training - GOV.UK",
+ "What is the schools response to the claim about Jane Doe? - School rejection - Claim #{@claim.reference} - Auditing - Claims - Claim funding for mentor training - GOV.UK",
)
expect(page).to have_element(
:span,
- text: "Reject - Claim #{@claim.reference}",
+ text: "School rejection - Claim #{@claim.reference}",
class: "govuk-caption-l",
)
expect(page).to have_h1("What is the schools response to the claim about Jane Doe?")
@@ -238,11 +239,11 @@ def then_i_see_the_rejection_reason_page_for_jane_doe
def then_i_see_the_rejection_reason_page_for_john_smith
expect(page).to have_title(
- "What is the schools response to the claim about John Smith? - Reject - Claim #{@claim.reference} - Auditing - Claims - Claim funding for mentor training - GOV.UK",
+ "What is the schools response to the claim about John Smith? - School rejection - Claim #{@claim.reference} - Auditing - Claims - Claim funding for mentor training - GOV.UK",
)
expect(page).to have_element(
:span,
- text: "Reject - Claim #{@claim.reference}",
+ text: "School rejection - Claim #{@claim.reference}",
class: "govuk-caption-l",
)
expect(page).to have_h1("What is the schools response to the claim about John Smith?")