Skip to content

Commit

Permalink
Don't ask for references or LoPS
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
thomasleese committed Feb 15, 2024
1 parent c8f5ae7 commit 7c6ed47
Show file tree
Hide file tree
Showing 4 changed files with 107 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,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
Expand Down Expand Up @@ -140,7 +143,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,
Expand Down Expand Up @@ -186,6 +189,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

Expand Down Expand Up @@ -247,6 +261,17 @@ def load_assessment_and_application_form
@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

def back_to_summary_path(ordinary_path)
if ActiveModel::Type::Boolean.new.cast(params[:back_to_summary])
[
Expand Down
4 changes: 3 additions & 1 deletion app/services/verify_assessment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
<p class="govuk-body">You have selected the following items for verification:</p>

<%= 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_path(@application_form, @assessment, back_to_summary: "true"), 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_path(@application_form, @assessment, back_to_summary: "true"), visually_hidden_text: "LoPS")
end %>
<% end %>

<%= summary_list.with_row do |row|
row.with_key { "Qualifications" }
Expand All @@ -28,26 +30,30 @@
row.with_action(text: "Change", href: verify_qualifications_assessor_interface_application_form_assessment_assessment_recommendation_verify_path(@application_form, @assessment, back_to_summary: "true"), visually_hidden_text: "qualifications")
end %>

<%= 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_path(@application_form, @assessment, back_to_summary: "true"), visually_hidden_text: "references")
end %>
<% unless @skip_references %>
<%= 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_path(@application_form, @assessment, back_to_summary: "true"), visually_hidden_text: "references")
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>
<% unless @skip_references %>
<li>email reference requests to the referee</li>
<li>email the applicant to let them know you have requested references</li>
<% end %>
<li>move this application into verification</li>
</ul>

Expand Down
56 changes: 54 additions & 2 deletions spec/system/assessor_interface/completing_assessment_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 7c6ed47

Please sign in to comment.