From 3b0cef469c3ba02ea80a23d2cd1e0bda50123057 Mon Sep 17 00:00:00 2001 From: Shujat Khalid Date: Mon, 6 Nov 2023 16:12:08 +0000 Subject: [PATCH] removed redundent code and added default to helper method --- .../assessor_interface/review_verifications_controller.rb | 1 - app/helpers/region_helper.rb | 4 ++-- .../assessor_interface/review_verifications/index.html.erb | 2 +- spec/support/autoload/page_objects/task_list.rb | 3 --- 4 files changed, 3 insertions(+), 7 deletions(-) diff --git a/app/controllers/assessor_interface/review_verifications_controller.rb b/app/controllers/assessor_interface/review_verifications_controller.rb index de12ce5180..786f1c6f56 100644 --- a/app/controllers/assessor_interface/review_verifications_controller.rb +++ b/app/controllers/assessor_interface/review_verifications_controller.rb @@ -2,7 +2,6 @@ module AssessorInterface class ReviewVerificationsController < BaseController - include RegionHelper before_action :authorize_assessor def index diff --git a/app/helpers/region_helper.rb b/app/helpers/region_helper.rb index 6368cef49e..b0e0029e5f 100644 --- a/app/helpers/region_helper.rb +++ b/app/helpers/region_helper.rb @@ -11,8 +11,8 @@ def region_certificate_phrase(region) "#{certificate.indefinite_article} #{tag.span(certificate, lang: region.country.code)}".html_safe end - def region_teaching_authority_name(region) - region.teaching_authority_name.presence || "teaching authority" + def region_teaching_authority_name(region, default = nil) + region.teaching_authority_name.presence || default || "teaching authority" end def region_teaching_authority_name_phrase(region) diff --git a/app/views/assessor_interface/review_verifications/index.html.erb b/app/views/assessor_interface/review_verifications/index.html.erb index 798cdf1859..38002180fb 100644 --- a/app/views/assessor_interface/review_verifications/index.html.erb +++ b/app/views/assessor_interface/review_verifications/index.html.erb @@ -14,7 +14,7 @@ title: "LoPS", items: [ { - name: (region_teaching_authority_name(@application_form.region) == "teaching authority") ? "Contact relevant competent authority" : region_teaching_authority_name(@application_form.region), + name: region_teaching_authority_name(@application_form.region, "Contact relevant competent authority"), link: [:review, :assessor_interface, @application_form, @assessment, :professional_standing_request], status: @professional_standing_request.review_status, } diff --git a/spec/support/autoload/page_objects/task_list.rb b/spec/support/autoload/page_objects/task_list.rb index 15d7624492..1a342923ca 100644 --- a/spec/support/autoload/page_objects/task_list.rb +++ b/spec/support/autoload/page_objects/task_list.rb @@ -1,8 +1,5 @@ module PageObjects class TaskList < SitePrism::Section - element :not_started_status, ".govuk-tag.govuk-tag--grey" - element :accepted_status, ".govuk-tag.govuk-tag--green" - sections :sections, TaskListSection, ".app-task-list > li" def find_item(text)