From b2776cf9f87ddcd9a039d5738a2750439807b04d Mon Sep 17 00:00:00 2001 From: Lori Bailey <44073106+elceebee@users.noreply.github.com> Date: Wed, 28 Aug 2024 08:21:55 +0100 Subject: [PATCH] Assume browser titles are html safe --- app/helpers/application_helper.rb | 2 +- ...ies_over_unsuccessful_application_to_new_cycle_spec.rb | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index e44f1c540d7..ea2cbc5fa26 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -8,7 +8,7 @@ module ApplicationHelper def browser_title page_browser_title = content_for(:browser_title).presence || content_for(:title) - [page_browser_title, service_name, 'GOV.UK'].select(&:present?).join(' - ') + [page_browser_title, service_name, 'GOV.UK'].select(&:present?).join(' - ').html_safe end def service_name diff --git a/spec/system/candidate_interface/carry_over/candidate_carries_over_unsuccessful_application_to_new_cycle_spec.rb b/spec/system/candidate_interface/carry_over/candidate_carries_over_unsuccessful_application_to_new_cycle_spec.rb index f7f2480bac7..1b61adee5f5 100644 --- a/spec/system/candidate_interface/carry_over/candidate_carries_over_unsuccessful_application_to_new_cycle_spec.rb +++ b/spec/system/candidate_interface/carry_over/candidate_carries_over_unsuccessful_application_to_new_cycle_spec.rb @@ -88,12 +88,15 @@ def and_i_have_an_application_with_a_rejection job = create(:application_work_experience, experienceable: @application_form) @application_form.application_work_experiences << [job] + @provider = @application_choice.provider end alias_method :given_i_have_an_application_with_a_rejection, :and_i_have_an_application_with_a_rejection def given_i_applied_two_years_ago @application_form = create(:completed_application_form, recruitment_cycle_year: 2.years.ago.year, candidate: @candidate) @application_choice = create(:application_choice, :rejected, application_form: @application_form) + @provider = @application_choice.provider + @provider.update(name: "St. Mary's") end def and_the_apply_deadline_passes @@ -131,15 +134,14 @@ def then_i_am_on_the_carry_over_page_between_cycles end def and_i_can_view_my_unsuccessful_application - click_on @application_choice.provider.name + click_on @provider.name expect(page) .to have_current_path( candidate_interface_course_choices_course_review_path( application_choice_id: @application_choice.id, ), ) - provider_name = smart_quotes(@application_choice.provider.name) - expect(page).to have_title("Your application to #{provider_name}") + expect(page).to have_title("Your application to #{@provider.name}") expect(page).to have_content('Unsuccessful') end