Skip to content

Commit

Permalink
Add verification requests summary page
Browse files Browse the repository at this point in the history
This adds a new page which summarises everything that is going to be
requested for verification.
  • Loading branch information
thomasleese committed Nov 28, 2023
1 parent 4290593 commit 1853827
Show file tree
Hide file tree
Showing 6 changed files with 92 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<% content_for :page_title, t(".heading") %>
<% content_for :back_link_url, assessor_interface_application_form_path(@application_form) %>

<h1 class="govuk-heading-xl"><%= t(".heading") %></h1>

<p class="govuk-body">You have selected the following items for verification:</p>

<%= 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 %>
<ul class="govuk-list govuk-list--bullet">
<% @qualifications.each do |qualification| %>
<li><%= qualification_title(qualification) %></li>
<% end %>
</ul><%
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 %>
<ul class="govuk-list govuk-list--bullet">
<% @work_histories.each do |work_history| %>
<li><%= work_history_name(work_history) %></li>
<% end %>
</ul><%
end
row.with_action(text: "Change", href: [:reference_requests, :assessor_interface, @application_form, @assessment, :assessment_recommendation_verify], visually_hidden_text: "LoPS")
end %>
<% end %>
<% end %>

<h2 class="govuk-heading-m">Submit your verification requests</h2>

<p class="govuk-body">Select submit to:</p>

<ul class="govuk-list govuk-list--bullet">
<li>email reference requests to the referee</li>
<li>email the applicant to let them know you have requested references</li>
<li>move this application into verification</li>
</ul>

<%= govuk_button_to "Submit", [:assessor_interface, @application_form, @assessment, :assessment_recommendation_verify], method: :put %>
2 changes: 2 additions & 0 deletions config/locales/assessor_interface.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions spec/support/page_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions spec/system/assessor_interface/completing_assessment_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 1853827

Please sign in to comment.