From 6fa3f3cd561710f62df9d6c2361bdcac07b04942 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 | 8 +-- 5 files changed, 16 insertions(+), 72 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 0824fc0c6c..3217cc9a63 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 @@ -258,8 +258,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 << assessment_recommendation_task_list_item if items.present? @@ -341,7 +340,7 @@ def assessment_recommendation_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 @@ -350,7 +349,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, @@ -359,49 +358,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 a2120deb31..5d3df82d66 100644 --- a/config/locales/assessor_interface.en.yml +++ b/config/locales/assessor_interface.en.yml @@ -22,10 +22,9 @@ en: assessment_recommendation: Assessment recommendation 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 assessments: 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 0ed8b851e5..79f4599f27 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 2788a5c831..6996b6555b 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 @@ -364,13 +364,7 @@ it do is_expected.to include_task_list_item( "Verification requests", - "Record LOPS response", - ) - end - it do - is_expected.to include_task_list_item( - "Verification requests", - "Review LOPS response", + "Verify LoPS", ) end it do