From 64fae0f3090a383e5584cd41410821efe9778952 Mon Sep 17 00:00:00 2001 From: Thomas Leese Date: Wed, 27 Sep 2023 10:32:34 +0100 Subject: [PATCH] Add "Verify LoPS" assessor task list item This updates the task list item that assessors and admins see when they need to verify the LoPS. --- .../application_forms_show_view_object.rb | 51 ++----------------- config/locales/assessor_interface.en.yml | 3 +- .../assessor_interface/application.rb | 8 +-- .../verifying_professional_standing_spec.rb | 18 +++---- ...application_forms_show_view_object_spec.rb | 13 +---- 5 files changed, 17 insertions(+), 76 deletions(-) diff --git a/app/view_objects/assessor_interface/application_forms_show_view_object.rb b/app/view_objects/assessor_interface/application_forms_show_view_object.rb index c5ea3abc6a..0e6792591f 100644 --- a/app/view_objects/assessor_interface/application_forms_show_view_object.rb +++ b/app/view_objects/assessor_interface/application_forms_show_view_object.rb @@ -254,8 +254,7 @@ def verification_task_list_section items = [ qualification_requests_task_list_item, reference_requests_task_list_item, - locate_professional_standing_request_task_list_item, - review_professional_standing_request_task_list_item, + professional_standing_request_task_list_item, ].compact items << verification_decision_task_list_item if items.present? @@ -316,7 +315,7 @@ def reference_requests_task_list_item } end - def locate_professional_standing_request_task_list_item + def professional_standing_request_task_list_item if teaching_authority_provides_written_statement || professional_standing_request.blank? return @@ -325,7 +324,7 @@ def locate_professional_standing_request_task_list_item { name: I18n.t( - "assessor_interface.application_forms.show.assessment_tasks.items.locate_professional_standing_request", + "assessor_interface.application_forms.show.assessment_tasks.items.professional_standing_request", ), link: [ :location, @@ -334,49 +333,7 @@ def locate_professional_standing_request_task_list_item assessment, :professional_standing_request, ], - status: - if professional_standing_request.ready_for_review || - professional_standing_request.received? - :completed - elsif professional_standing_request.expired? - :overdue - else - :waiting_on - end, - } - end - - def review_professional_standing_request_task_list_item - if teaching_authority_provides_written_statement || - professional_standing_request.blank? - return - end - - { - name: - I18n.t( - "assessor_interface.application_forms.show.assessment_tasks.items.review_professional_standing_request", - ), - link: - if professional_standing_request.received? || - professional_standing_request.ready_for_review - [ - :review, - :assessor_interface, - application_form, - assessment, - :professional_standing_request, - ] - end, - status: - if professional_standing_request.reviewed? - :completed - elsif professional_standing_request.received? || - professional_standing_request.ready_for_review - :received - else - :cannot_start - end, + status: professional_standing_request.status, } end diff --git a/config/locales/assessor_interface.en.yml b/config/locales/assessor_interface.en.yml index a44c957bb2..5b47783041 100644 --- a/config/locales/assessor_interface.en.yml +++ b/config/locales/assessor_interface.en.yml @@ -22,10 +22,9 @@ en: assessment_decision: Assessment decision await_professional_standing_request: Awaiting third-party professional standing initial_assessment_recommendation: Initial assessment recommendation - locate_professional_standing_request: Record LOPS response + professional_standing_request: Verify LoPS qualification_requests: Record qualifications responses reference_requests: Verify reference requests - review_professional_standing_request: Review LOPS response review_requested_information: Review requested information from applicant review_verifications: Review verifications verification_decision: Verification decision diff --git a/spec/support/autoload/page_objects/assessor_interface/application.rb b/spec/support/autoload/page_objects/assessor_interface/application.rb index 7539de9b6b..a170f9d813 100644 --- a/spec/support/autoload/page_objects/assessor_interface/application.rb +++ b/spec/support/autoload/page_objects/assessor_interface/application.rb @@ -82,12 +82,8 @@ def verify_references_task task_list.find_item("Verify reference requests") end - def record_professional_standing_request_task - task_list.find_item("Record LOPS response") - end - - def review_professional_standing_request_task - task_list.find_item("Review LOPS response") + def professional_standing_request_task + task_list.find_item("Verify LoPS") end end end diff --git a/spec/system/assessor_interface/verifying_professional_standing_spec.rb b/spec/system/assessor_interface/verifying_professional_standing_spec.rb index f281aa0cf4..73e817aa19 100644 --- a/spec/system/assessor_interface/verifying_professional_standing_spec.rb +++ b/spec/system/assessor_interface/verifying_professional_standing_spec.rb @@ -12,7 +12,7 @@ it "record location and review" do when_i_visit_the(:assessor_application_page, application_id:) and_i_see_a_waiting_on_status - and_i_click_record_professional_standing_task + and_i_click_professional_standing_task then_i_see_the( :assessor_edit_professional_standing_request_location_page, application_id:, @@ -44,18 +44,16 @@ def and_i_see_a_waiting_on_status ) end - def and_i_click_record_professional_standing_task - assessor_application_page - .record_professional_standing_request_task - .link - .click + def and_i_click_professional_standing_task + assessor_application_page.professional_standing_request_task.link.click end def when_i_click_review_professional_standing_task - assessor_application_page - .review_professional_standing_request_task - .link - .click + when_i_visit_the( + :assessor_edit_professional_standing_request_review_page, + application_id:, + assessment_id: application_form.assessment.id, + ) end def when_i_fill_in_the_location_form diff --git a/spec/view_objects/assessor_interface/application_forms_show_view_object_spec.rb b/spec/view_objects/assessor_interface/application_forms_show_view_object_spec.rb index ae9a464c01..c5d3092e59 100644 --- a/spec/view_objects/assessor_interface/application_forms_show_view_object_spec.rb +++ b/spec/view_objects/assessor_interface/application_forms_show_view_object_spec.rb @@ -96,7 +96,7 @@ "Further information requests", ) end - it { is_expected.to_not include_task_list_section("Verification requests") } + it { is_expected.to_not include_task_list_section("Verification") } context "when teaching authority provides written statement and a professional standing request" do let!(:professional_standing_request) do @@ -362,16 +362,7 @@ before { create(:professional_standing_request, assessment:) } it do - is_expected.to include_task_list_item( - "Verification", - "Record LOPS response", - ) - end - it do - is_expected.to include_task_list_item( - "Verification", - "Review LOPS response", - ) + is_expected.to include_task_list_item("Verification", "Verify LoPS") end it do is_expected.to include_task_list_item(