From 1853827d7fa5fc2e70d0987ee047f0b842e2749f Mon Sep 17 00:00:00 2001 From: Thomas Leese Date: Tue, 28 Nov 2023 14:42:36 +0000 Subject: [PATCH] Add verification requests summary page This adds a new page which summarises everything that is going to be requested for verification. --- ...ssment_recommendation_verify_controller.rb | 6 ++ .../edit.html.erb | 56 +++++++++++++++++++ config/locales/assessor_interface.en.yml | 2 + .../assessment_recommendation_verify.rb | 12 ++++ spec/support/page_helpers.rb | 5 ++ .../completing_assessment_spec.rb | 11 ++++ 6 files changed, 92 insertions(+) create mode 100644 app/views/assessor_interface/assessment_recommendation_verify/edit.html.erb create mode 100644 spec/support/autoload/page_objects/assessor_interface/assessment_recommendation_verify.rb diff --git a/app/controllers/assessor_interface/assessment_recommendation_verify_controller.rb b/app/controllers/assessor_interface/assessment_recommendation_verify_controller.rb index aa2b8b3dbb..1a8bfa3576 100644 --- a/app/controllers/assessor_interface/assessment_recommendation_verify_controller.rb +++ b/app/controllers/assessor_interface/assessment_recommendation_verify_controller.rb @@ -19,6 +19,12 @@ def show def edit authorize %i[assessor_interface assessment_recommendation] + + @professional_standing = session[:professional_standing] + @qualifications = + application_form.qualifications.where(id: session[:qualification_ids]) + @work_histories = + application_form.work_histories.where(id: session[:work_history_ids]) end def update diff --git a/app/views/assessor_interface/assessment_recommendation_verify/edit.html.erb b/app/views/assessor_interface/assessment_recommendation_verify/edit.html.erb new file mode 100644 index 0000000000..bb05a3821e --- /dev/null +++ b/app/views/assessor_interface/assessment_recommendation_verify/edit.html.erb @@ -0,0 +1,56 @@ +<% content_for :page_title, t(".heading") %> +<% content_for :back_link_url, assessor_interface_application_form_path(@application_form) %> + +

<%= t(".heading") %>

+ +

You have selected the following items for verification:

+ +<%= govuk_summary_list do |summary_list| %> + <% if @professional_standing %> + <%= summary_list.with_row do |row| + row.with_key { "LoPS" } + row.with_value { region_teaching_authority_name(@application_form.region).upcase_first } + row.with_action(text: "Change", href: [:professional_standing, :assessor_interface, @application_form, @assessment, :assessment_recommendation_verify], visually_hidden_text: "LoPS") + end %> + <% end %> + + <% if @qualifications.present? %> + <%= summary_list.with_row do |row| + row.with_key { "Qualifications" } + row.with_value do %> + <% + end + row.with_action(text: "Change", href: [:verify_qualifications, :assessor_interface, @application_form, @assessment, :assessment_recommendation_verify], visually_hidden_text: "LoPS") + end %> + <% end %> + + <% if @work_histories.present? %> + <%= 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: "LoPS") + end %> + <% end %> +<% end %> + +

Submit your verification requests

+ +

Select submit to:

+ + + +<%= govuk_button_to "Submit", [:assessor_interface, @application_form, @assessment, :assessment_recommendation_verify], method: :put %> diff --git a/config/locales/assessor_interface.en.yml b/config/locales/assessor_interface.en.yml index da0dce990f..f95a2e376e 100644 --- a/config/locales/assessor_interface.en.yml +++ b/config/locales/assessor_interface.en.yml @@ -85,6 +85,8 @@ en: heading: Send application for review assessment_recommendation_verify: + edit: + heading: Verification requests edit_qualification_requests: heading: Verify qualifications edit_verify_qualifications: diff --git a/spec/support/autoload/page_objects/assessor_interface/assessment_recommendation_verify.rb b/spec/support/autoload/page_objects/assessor_interface/assessment_recommendation_verify.rb new file mode 100644 index 0000000000..660563dd1c --- /dev/null +++ b/spec/support/autoload/page_objects/assessor_interface/assessment_recommendation_verify.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module PageObjects + module AssessorInterface + class AssessmentRecommendationVerify < SitePrism::Page + set_url "/assessor/applications/{reference}/assessments/{assessment_id}" \ + "/recommendation/verify/edit" + + element :submit_button, ".govuk-button" + end + end +end diff --git a/spec/support/page_helpers.rb b/spec/support/page_helpers.rb index 6b7fabc6af..32ea047a45 100644 --- a/spec/support/page_helpers.rb +++ b/spec/support/page_helpers.rb @@ -32,6 +32,11 @@ def assessor_assessment_recommendation_review_page PageObjects::AssessorInterface::AssessmentRecommendationReview.new end + def assessor_assessment_recommendation_verify_page + @assessor_assessment_recommendation_verify_page ||= + PageObjects::AssessorInterface::AssessmentRecommendationVerify.new + end + def assessor_assessment_section_page @assessor_assessment_section_page ||= PageObjects::AssessorInterface::AssessmentSection.new diff --git a/spec/system/assessor_interface/completing_assessment_spec.rb b/spec/system/assessor_interface/completing_assessment_spec.rb index c63471394c..aa52ccafe0 100644 --- a/spec/system/assessor_interface/completing_assessment_spec.rb +++ b/spec/system/assessor_interface/completing_assessment_spec.rb @@ -129,6 +129,13 @@ ) when_i_select_the_work_histories + 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 @@ -353,6 +360,10 @@ def when_i_select_the_work_histories form.submit_button.click end + def when_i_select_submit_verification_requests + assessor_assessment_recommendation_verify_page.submit_button.click + end + def when_i_send_the_email assessor_preview_assessment_recommendation_page.send_button.click end