Skip to content

Commit

Permalink
removed redundent code and added default to helper method
Browse files Browse the repository at this point in the history
  • Loading branch information
syed87 committed Nov 6, 2023
1 parent d377a83 commit 3b0cef4
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

module AssessorInterface
class ReviewVerificationsController < BaseController
include RegionHelper
before_action :authorize_assessor

def index
Expand Down
4 changes: 2 additions & 2 deletions app/helpers/region_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down
3 changes: 0 additions & 3 deletions spec/support/autoload/page_objects/task_list.rb
Original file line number Diff line number Diff line change
@@ -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)
Expand Down

0 comments on commit 3b0cef4

Please sign in to comment.