Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix page title not rendering correctly, causing flaky tests #9756

Merged
merged 1 commit into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
Loading