Skip to content

Commit

Permalink
Update content for existing session page
Browse files Browse the repository at this point in the history
* LUPEYALPHA-745
* LUPEYALPHA-796
* TODO: update error message content if option not selected (LUPEYALPHA-707)
  • Loading branch information
kenfodder committed Aug 2, 2024
1 parent 614d6a7 commit 4fc2c18
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 52 deletions.
5 changes: 0 additions & 5 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ def journey_service_name(routing_name = nil)
t("#{namespace}.journey_name")
end

def journey_description(routing_name)
namespace = Journeys.for_routing_name(routing_name)::I18N_NAMESPACE
t("#{namespace}.claim_description")
end

def feedback_email(routing_name)
namespace = Journeys.for_routing_name(routing_name)::I18N_NAMESPACE
t("#{namespace}.feedback_email")
Expand Down
37 changes: 18 additions & 19 deletions app/views/claims/existing_session.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,27 @@
<div class="govuk-panel govuk-panel--interruption">
<%= form_with url: start_new_path(journey: current_journey_routing_name), builder: GOVUKDesignSystemFormBuilder::FormBuilder do |f| %>
<% radio_options = [
OpenStruct.new(id: true, name: "Yes, start claim #{journey_description(current_journey_routing_name)} and lose my progress on my first claim"),
OpenStruct.new(id: false, name: "No, finish the claim I have in progress"),
] %>
OpenStruct.new(id: false, name: "Continue with the eligibility check that you have already started"),
OpenStruct.new(id: true, name: "Start a new eligibility check")] %>

<%= f.govuk_collection_radio_buttons :start_new_claim, radio_options, :id, :name,
class: "govuk-!-margin-bottom-6",
legend: {
text: "Are you sure you want to start a claim #{journey_description(current_journey_routing_name)}?",
tag: "h1",
size: "xl",
class: "govuk-!-margin-bottom-9"
} do %>
<h2 class="govuk-heading-m">
You have a claim in progress <%= journey_description(@existing_session.journey) %>.
</h2>
<%= f.govuk_collection_radio_buttons :start_new_claim, radio_options, :id, :name,
class: "govuk-!-margin-bottom-6",
legend: {
text: "You have already started an eligibility check",
tag: "h1",
size: "xl",
class: "govuk-!-margin-bottom-9"
} do %>
<h2 class="govuk-heading-m">
You can only have one eligibility check in progress at any time. If you want to start another check, we will delete the data on the check you have already started.
</h2>

<h2 class="govuk-heading-m">
You will lose your progress on this claim if you start a different claim before you send it.
</h2>
<% end %>
<h2 class="govuk-heading-m">
Choose what you want to do:
</h2>
<% end %>

<%= f.govuk_submit "Submit", secondary: true %>
<%= f.govuk_submit "Continue" %>
<% end %>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions spec/features/combined_teacher_claim_journey_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
click_on "Start now"
expect(page).to have_current_path("/#{Journeys::AdditionalPaymentsForTeaching::ROUTING_NAME}/existing-session")

choose "Yes, start claim for an additional payment for teaching and lose my progress on my first claim"
click_on "Submit"
choose "Start a new eligibility check"
click_on "Continue"

skip_tid

Expand Down
32 changes: 16 additions & 16 deletions spec/features/switching_policies_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
expect(page.title).to have_text(I18n.t("additional_payments.journey_name"))
expect(page.find("header")).to have_text(I18n.t("additional_payments.journey_name"))

choose "Yes, start claim for an additional payment for teaching and lose my progress on my first claim"
click_on "Submit"
choose "Start a new eligibility check"
click_on "Continue"

expect(page).to have_text("You can sign in or set up a DfE Identity account to make it easier to claim additional payments.")
end

scenario "a user can choose to continue their claim" do
choose "No, finish the claim I have in progress"
click_on "Submit"
choose "Continue with the eligibility check that you have already started"
click_on "Continue"

expect(page).to have_text(claim_school_question)
end
Expand Down Expand Up @@ -55,18 +55,18 @@
have_text(I18n.t("get_a_teacher_relocation_payment.journey_name"))
)

choose "Yes, start claim for a get a teacher relocation payment and lose my progress on my first claim"
choose "Start a new eligibility check"

click_on "Submit"
click_on "Continue"

expect(page.title).to include(
"What is your employment status? — Get a teacher relocation payment"
)
end

scenario "a user can choose to continue their claim" do
choose "No, finish the claim I have in progress"
click_on "Submit"
choose "Continue with the eligibility check that you have already started"
click_on "Continue"

expect(page.title).to include("Claim additional payments for teaching")
end
Expand All @@ -85,13 +85,13 @@
end

scenario "a user can switch to a different policy after starting a claim on another" do
expect(page).to have_content "Are you sure you want to start a claim for an additional payment for teaching?"
expect(page).to have_content "You have already started an eligibility check"

expect(page).to have_content "You have a claim in progress for a get a teacher relocation payment"
expect(page).to have_content "You can only have one eligibility check in progress at any time."

choose "Yes, start claim for an additional payment for teaching and lose my progress on my first claim"
choose "Start a new eligibility check"

click_on "Submit"
click_on "Continue"
end
end

Expand All @@ -112,12 +112,12 @@
visit new_claim_path("additional-payments")

expect(page).to(have_text(
"You have a claim in progress for an additional payment for teaching."
"You have already started an eligibility check"
))

choose "No, finish the claim I have in progress"
choose "Continue with the eligibility check that you have already started"

click_on "Submit"
click_on "Continue"

expect(page).to have_text(
"Are you currently teaching as a qualified teacher?"
Expand All @@ -129,7 +129,7 @@
start_student_loans_claim
visit new_claim_path("additional-payments")

click_on "Submit"
click_on "Continue"

expect(page).to have_text("Select yes if you want to start a claim for an additional payment for teaching")
end
Expand Down
10 changes: 0 additions & 10 deletions spec/helpers/application_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,6 @@
end
end

describe "#journey_description" do
it "returns description for student loans" do
expect(journey_description("student-loans")).to eq t("student_loans.claim_description")
end

it "returns description for early career payments" do
expect(journey_description("additional-payments")).to eq t("additional_payments.claim_description")
end
end

describe "#information_provided_further_details_with_link" do
subject { information_provided_further_details_with_link(policy:) }

Expand Down

0 comments on commit 4fc2c18

Please sign in to comment.