From b814fde2bd5cd48333b6d87a0ec016d32b9d3832 Mon Sep 17 00:00:00 2001 From: Thomas Leese Date: Thu, 1 Feb 2024 11:45:41 +0000 Subject: [PATCH] Don't ask for references or LoPS For countries where work history is not required or where reduced evidence is accepted, we won't be verifying the LoPS or the references, so we shouldn't be asking the assessors to provide this. --- ...ssment_recommendation_verify_controller.rb | 27 ++++++++- app/services/verify_assessment.rb | 4 +- .../edit.html.erb | 42 ++++++++------ .../completing_assessment_spec.rb | 56 ++++++++++++++++++- 4 files changed, 107 insertions(+), 22 deletions(-) diff --git a/app/controllers/assessor_interface/assessment_recommendation_verify_controller.rb b/app/controllers/assessor_interface/assessment_recommendation_verify_controller.rb index 8f2503e232..ca2c458cf7 100644 --- a/app/controllers/assessor_interface/assessment_recommendation_verify_controller.rb +++ b/app/controllers/assessor_interface/assessment_recommendation_verify_controller.rb @@ -29,6 +29,9 @@ def edit application_form.qualifications.where(id: session[:qualification_ids]) @work_histories = application_form.work_histories.where(id: session[:work_history_ids]) + + @skip_professional_standing = skip_professional_standing? + @skip_references = skip_references? end def update @@ -146,7 +149,7 @@ def email_consent_letters def edit_professional_standing authorize %i[assessor_interface assessment_recommendation], :edit? - if application_form.teaching_authority_provides_written_statement + if skip_professional_standing? redirect_to [ :reference_requests, :assessor_interface, @@ -194,6 +197,17 @@ def update_professional_standing def edit_reference_requests authorize %i[assessor_interface assessment_recommendation], :edit? + if skip_references? + redirect_to [ + :edit, + :assessor_interface, + application_form, + assessment, + :assessment_recommendation_verify, + ] + return + end + @form = SelectWorkHistoriesForm.new(application_form:, session:) end @@ -256,5 +270,16 @@ def load_assessment_and_application_form @assessment = assessment @application_form = application_form end + + def skip_professional_standing? + application_form.teaching_authority_provides_written_statement || + application_form.reduced_evidence_accepted || + !application_form.needs_work_history + end + + def skip_references? + application_form.reduced_evidence_accepted || + !application_form.needs_work_history + end end end diff --git a/app/services/verify_assessment.rb b/app/services/verify_assessment.rb index c743540578..07ccc09360 100644 --- a/app/services/verify_assessment.rb +++ b/app/services/verify_assessment.rb @@ -35,7 +35,9 @@ def call reference_requests end - send_reference_request_emails(reference_requests) + if reference_requests.present? + send_reference_request_emails(reference_requests) + end reference_requests end diff --git a/app/views/assessor_interface/assessment_recommendation_verify/edit.html.erb b/app/views/assessor_interface/assessment_recommendation_verify/edit.html.erb index 356c118b8a..ecef5c958f 100644 --- a/app/views/assessor_interface/assessment_recommendation_verify/edit.html.erb +++ b/app/views/assessor_interface/assessment_recommendation_verify/edit.html.erb @@ -6,11 +6,13 @@

You have selected the following items for verification:

<%= govuk_summary_list do |summary_list| %> - <%= summary_list.with_row do |row| - row.with_key { "LoPS" } - row.with_value { @professional_standing ? region_teaching_authority_name(@application_form.region).upcase_first : "Not selected" } - row.with_action(text: "Change", href: [:professional_standing, :assessor_interface, @application_form, @assessment, :assessment_recommendation_verify], visually_hidden_text: "LoPS") - end %> + <% unless @skip_professional_standing %> + <%= summary_list.with_row do |row| + row.with_key { "LoPS" } + row.with_value { @professional_standing ? region_teaching_authority_name(@application_form.region).upcase_first : "Not selected" } + row.with_action(text: "Change", href: [:professional_standing, :assessor_interface, @application_form, @assessment, :assessment_recommendation_verify], visually_hidden_text: "LoPS") + end %> + <% end %> <%= summary_list.with_row do |row| row.with_key { "Qualifications" } @@ -28,17 +30,19 @@ row.with_action(text: "Change", href: [:verify_qualifications, :assessor_interface, @application_form, @assessment, :assessment_recommendation_verify], visually_hidden_text: "qualifications") end %> - <%= summary_list.with_row do |row| - row.with_key { "References" } - row.with_value do %> - - <% end - row.with_action(text: "Change", href: [:reference_requests, :assessor_interface, @application_form, @assessment, :assessment_recommendation_verify], visually_hidden_text: "references") - end %> + <% unless @skip_references %> + <%= summary_list.with_row do |row| + row.with_key { "References" } + row.with_value do %> + + <% end + row.with_action(text: "Change", href: [:reference_requests, :assessor_interface, @application_form, @assessment, :assessment_recommendation_verify], visually_hidden_text: "references") + end %> + <% end %> <% end %>

Submit your verification requests

@@ -46,8 +50,10 @@

Select submit to:

diff --git a/spec/system/assessor_interface/completing_assessment_spec.rb b/spec/system/assessor_interface/completing_assessment_spec.rb index 3c672fe447..28bdbe36b0 100644 --- a/spec/system/assessor_interface/completing_assessment_spec.rb +++ b/spec/system/assessor_interface/completing_assessment_spec.rb @@ -87,7 +87,7 @@ it "verify" do given_the_service_is_open given_i_am_authorized_as_an_assessor_user - given_there_is_an_awardable_application_form_under_new_regulations + given_there_is_an_awardable_application_form_with_work_history when_i_visit_the( :assessor_complete_assessment_page, @@ -145,6 +145,53 @@ then_the_application_form_is_waiting_on end + it "verify with reduced evidence" do + given_the_service_is_open + given_i_am_authorized_as_an_assessor_user + given_there_is_an_awardable_application_form_with_reduced_evidence + + when_i_visit_the( + :assessor_complete_assessment_page, + reference:, + assessment_id:, + ) + + when_i_select_award_qts_pending_verifications + and_i_click_continue + then_i_see_the( + :assessor_verify_qualifications_assessment_recommendation_verify_page, + reference:, + assessment_id:, + ) + + when_i_select_yes_verify_qualifications + then_i_see_the( + :assessor_qualification_requests_assessment_recommendation_verify_page, + reference:, + assessment_id:, + ) + + when_i_select_the_qualifications + then_i_see_the( + :assessor_email_consent_letters_requests_assessment_recommendation_verify_page, + reference:, + assessment_id:, + ) + + when_i_click_continue_from_email_consent_letters + then_i_see_the( + :assessor_assessment_recommendation_verify_page, + reference:, + assessment_id:, + ) + + when_i_select_submit_verification_requests + then_i_see_the(:assessor_application_status_page, reference:) + + when_i_click_on_overview_button + then_the_application_form_is_waiting_on + end + it "decline" do given_the_service_is_open given_i_am_authorized_as_an_assessor_user @@ -216,11 +263,16 @@ def given_there_is_an_awardable_application_form(traits = []) create(:assessment_section, :personal_information, :passed, assessment:) end - def given_there_is_an_awardable_application_form_under_new_regulations + def given_there_is_an_awardable_application_form_with_work_history given_there_is_an_awardable_application_form create(:work_history, :completed, application_form:) end + def given_there_is_an_awardable_application_form_with_reduced_evidence + given_there_is_an_awardable_application_form + application_form.update!(reduced_evidence_accepted: true) + end + def given_there_is_a_declinable_application_form @application_form ||= create(