Skip to content

Commit

Permalink
Update system tests for verifying LoPS
Browse files Browse the repository at this point in the history
This updates the system tests for verifying LoPS to use the newer verify
page and updates to use the right permissions.
  • Loading branch information
thomasleese committed Nov 3, 2023
1 parent ee553c2 commit 31e9cc8
Show file tree
Hide file tree
Showing 13 changed files with 67 additions and 32 deletions.
2 changes: 1 addition & 1 deletion app/components/status_tag/component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def tags
received_reference: "purple",
rejected: "red",
requested: "yellow",
review: "purple",
review: "pink",
submitted: "grey",
valid: "green",
verification: "yellow",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ def index

@professional_standing_request =
assessment.professional_standing_request if assessment.professional_standing_request.verify_failed?

render layout: "full_from_desktop"
end

private
Expand Down
2 changes: 1 addition & 1 deletion app/models/concerns/requestable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def verify_failed?

def status
if verify_passed? || review_passed?
"accepted"
"completed"
elsif review_failed?
"rejected"
elsif verify_failed?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

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

<p class="govuk-body">If you choose to verify this applicant’s letter of professional standing, you’ll need to email the competent authority directly, then come back to record the outcome.</p>
<p class="govuk-body">If you choose to verify this application's LoPS an admin will email the competent authority and record the response.</p>

<%= f.govuk_collection_radio_buttons :verify_professional_standing, %i[true false], :itself, legend: nil %>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,25 @@

<h1 class="govuk-heading-xl"><%= title %></h1>

<p class="govuk-body">To verify the applications LoPS you need to:</p>
<p class="govuk-body">To verify the application’s LoPS you need to:</p>

<ul class="govuk-list govuk-list--bullet">
<li> go to the Zendesk and apply email macro 'PR Request LoPS verification'</li>
<li> go to Zendesk and apply email macro PR Request LoPS verification</li>
<li> add the applicant's details to the email</li>
<li> attach the LoPS to the email</li>
<li> find the relevant authority's and document their LoPS document</li>
<li> find the relevant authority’s details on the LoPS document</li>
<li> send the email to the relevant teaching authority</li>
</ul>

<p class="govuk-body">
<p class="govuk-body govuk-!-padding-top-6">
Do you want to mark this task as completed and come back after you have sent the email from Zendesk?
</p>

<%= form_with model: @form, url: [:request, :assessor_interface, @application_form, @assessment, :professional_standing_request] do |f| %>
<%= f.govuk_radio_button :passed, :true, label: { text: "Yes, mark as completed" }, link_errors: true %>
<%= f.govuk_radio_button :passed, :false, label: { text: "No, come back later" } %>
<%= f.govuk_radio_buttons_fieldset :passed, legend: nil do %>
<%= f.govuk_radio_button :passed, :true, label: { text: "Yes, mark as completed" }, link_errors: true %>
<%= f.govuk_radio_button :passed, :false, label: { text: "No, come back later" } %>
<% end %>

<%= f.govuk_submit do %>
<%= govuk_link_to "Cancel", [:assessor_interface, @application_form, @assessment, :professional_standing_request] %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<h1 class="govuk-heading-xl">Verify LoPS</h1>

<p class="govuk-body">
You need to request verification for this applications LoPS. Follow the steps below:
You need to request verification for this application’s LoPS.
</p>

<%= render(TaskList::Component.new(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@

<h1 class="govuk-heading-xl">Review verifications</h1>

<p class="govuk-body govuk-!-padding-bottom-2">
The following verification tasks have been flagged for review:
</p>

<%= govuk_table do |table|
if @professional_standing_request.present?
table.with_caption(text: "LoPS")
Expand All @@ -15,4 +19,6 @@
end
end %>

<%= govuk_button_link_to "Back to overview", [:assessor_interface, @application_form] %>
<div class="govuk-!-padding-top-3">
<%= govuk_button_link_to "Back to overview", [:assessor_interface, @application_form] %>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ def request_further_information
def decline_qts
new_states.find { |radio_item| radio_item.label.text == "Decline QTS" }
end

def send_for_review
new_states.find do |radio_item|
radio_item.label.text == "Send application for review"
end
end
end
end
end
2 changes: 1 addition & 1 deletion spec/support/shared_examples/requestable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
it "is accepted when passed is true" do
subject.review_passed = true
subject.reviewed_at = Time.zone.now
expect(subject.status).to eq("accepted")
expect(subject.status).to eq("completed")
end

it "is rejected when passed is false" do
Expand Down
6 changes: 3 additions & 3 deletions spec/system/assessor_interface/pre_assessment_tasks_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
end

it "locate professional standing" do
when_i_visit_the(:assessor_application_page, application_id:)
then_i_see_the(:assessor_application_page, application_id:)
when_i_visit_the(:assessor_application_page, application_form_id:)
then_i_see_the(:assessor_application_page, application_form_id:)
and_i_see_a_waiting_on_status
and_i_click_awaiting_professional_standing
then_i_see_the(
Expand All @@ -53,7 +53,7 @@
)

when_i_fill_in_the_locate_form
then_i_see_the(:assessor_application_page, application_id:)
then_i_see_the(:assessor_application_page, application_form_id:)
and_i_see_a_preliminary_check_status
and_the_teacher_receives_a_professional_standing_received_email
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,18 @@
then_i_see_the(:assessor_application_page, application_form_id:)

when_i_click_on_verification_decision
then_i_see_the(:assessor_complete_assessment_page, application_form_id:)

when_i_select_send_for_review
then_i_see_the(
:assessor_assessment_recommendation_review_page,
application_form_id:,
)

when_i_click_continue_from_review
then_i_see_the(:assessor_application_status_page, application_form_id:)

when_i_click_on_overview_button
then_i_see_the(:assessor_application_page, application_form_id:)

when_i_click_on_review_verifications
Expand Down Expand Up @@ -58,12 +70,19 @@ def given_there_is_an_application_form_with_failed_verifications

def when_i_click_on_verification_decision
assessor_application_page.verification_decision_task.click
end

# TODO: review functionality is not built yet, this page can never be reached
application_form.assessment.review!
def when_i_select_send_for_review
assessor_complete_assessment_page.send_for_review.choose
assessor_complete_assessment_page.continue_button.click
end

# TODO: reload the page
when_i_visit_the(:assessor_application_page, application_form_id:)
def when_i_click_continue_from_review
assessor_assessment_recommendation_review_page.continue_button.click
end

def when_i_click_on_overview_button
assessor_application_status_page.button_group.overview_button.click
end

def when_i_click_on_review_verifications
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,18 @@
)
and_the_request_lops_verification_status_is("COMPLETED")

# when_i_click_record_lops_verification
# then_i_see_the(
# :assessor_verify_professional_standing_request_page,
# application_form_id:,
# assessment_id:,
# )
# and_i_fill_in_the_verify_form
# then_i_see_the(
# :assessor_professional_standing_request_page,
# application_form_id:,
# assessment_id:,
# )
when_i_click_record_lops_verification
then_i_see_the(
:assessor_verify_professional_standing_request_page,
application_form_id:,
assessment_id:,
)
and_i_fill_in_the_verify_form
then_i_see_the(
:assessor_professional_standing_request_page,
application_form_id:,
assessment_id:,
)
end

private
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def when_i_verify_the_reference_request
def then_i_see_the_reference_request_status_is_accepted
expect(
assessor_reference_requests_page.task_list.status_tags.first.text,
).to eq("ACCEPTED")
).to eq("COMPLETED")
end

def when_i_verify_that_all_references_are_accepted
Expand Down

0 comments on commit 31e9cc8

Please sign in to comment.