From ca6bf4c2ca610a78c122a0403429a31925779806 Mon Sep 17 00:00:00 2001 From: kosiakkatrina <54268893+kosiakkatrina@users.noreply.github.com> Date: Thu, 2 Dec 2021 12:26:04 +0000 Subject: [PATCH] CLDC-763 (#136) * refactor * refactor * update default title * Add tests for application helper --- app/helpers/application_helper.rb | 3 +++ app/views/case_logs/edit.html.erb | 2 +- app/views/case_logs/index.html.erb | 2 +- app/views/devise/sessions/new.html.erb | 2 +- app/views/form/check_answers.html.erb | 2 +- app/views/form/page.html.erb | 2 +- app/views/layouts/application.html.erb | 2 +- app/views/organisations/show.html.erb | 2 +- app/views/organisations/users.html.erb | 2 +- app/views/users/show.html.erb | 2 +- spec/helpers/application_helper.rb | 20 ++++++++++++++++++++ 11 files changed, 32 insertions(+), 9 deletions(-) create mode 100644 spec/helpers/application_helper.rb diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index de6be7945..9ad342b8a 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1,2 +1,5 @@ module ApplicationHelper + def browser_title(title) + [title, t("service_name"), "GOV.UK"].select(&:present?).join(" - ") + end end diff --git a/app/views/case_logs/edit.html.erb b/app/views/case_logs/edit.html.erb index 19b274488..d387aecea 100644 --- a/app/views/case_logs/edit.html.erb +++ b/app/views/case_logs/edit.html.erb @@ -1,4 +1,4 @@ -<% content_for :title, "Case log #{@case_log.id} – #{t('service_name')} - GOV.UK" %> +<% content_for :title, "Case log #{@case_log.id}" %> <%= turbo_frame_tag "case_log_form", target: "_top" do %>