-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement interruption pages for ENIC
- Loading branch information
Showing
9 changed files
with
249 additions
and
1 deletion.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
app/controllers/candidate_interface/course_choices/review_enic_interruption_controller.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
module CandidateInterface | ||
module CourseChoices | ||
class ReviewEnicInterruptionController < CandidateInterface::CourseChoices::BaseController | ||
before_action :redirect_to_your_applications_if_submitted | ||
before_action :viewed_enic_interruption_page, only: :show | ||
|
||
def show | ||
set_enic_reviewed_cookie | ||
end | ||
|
||
private | ||
|
||
def viewed_enic_interruption_page | ||
if cookies[:viewed_enic_interruption_page] == 'true' | ||
redirect_to candidate_interface_course_choices_course_review_and_submit_path(@application_choice.id) | ||
end | ||
end | ||
|
||
def set_enic_reviewed_cookie | ||
cookies[:viewed_enic_interruption_page] = { value: 'true' } | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
app/views/candidate_interface/course_choices/review_enic_interruption/_not_needed.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<div class="govuk-grid-row"> | ||
<div class="govuk-grid-column-three-quarters"> | ||
<div class="app-grid-column--grey"> | ||
<h1 class="govuk-heading-l">You have not included a UK ENIC reference number </h1> | ||
|
||
<p class="govuk-body">Including a UK ENIC reference number in your application makes youn around <b> 30% more likely to receive an offer.</b></p> | ||
<p class="govuk-body">If you apply for a UK ENIC statement of comparability (opens in new tab) <%= govuk_link_to('save this application as a draft', candidate_interface_course_choices_course_review_path(current_application.id)) %> and include the reference number in your application it makes it easier for training providers to understand your qualifications.</p> | ||
<p class="govuk-body">If you don’t include a UK ENIC statement of comparability and the provider asks for one, it could cause delays.</p> | ||
</div> | ||
|
||
<div class="govuk-button-group app-course-choice__confirm-submission"> | ||
<%= govuk_button_to('Continue without a UK ENIC number', candidate_interface_course_choices_course_review_and_submit_path(@application_choice.id), method: :get) %> | ||
<%= govuk_link_to('Save this application as a draft', candidate_interface_course_choices_course_review_path(current_application.id)) %> | ||
</div> | ||
</div> | ||
</div> |
20 changes: 20 additions & 0 deletions
20
...views/candidate_interface/course_choices/review_enic_interruption/_waiting_maybe.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<div class="govuk-grid-row"> | ||
<div class="govuk-grid-column-three-quarters"> | ||
<div class="app-grid-column--grey"> | ||
<h1 class="govuk-heading-l">You have not included a UK ENIC reference number </h1> | ||
|
||
<p class="govuk-body"> | ||
You have said you had, or planned. to <%= govuk_link_to('apply for a statement of comparability from UK ENIC (opens in new tab)', 'https://www.enic.org.uk/Qualifications/SOC/Default.aspx') %> | ||
but you have not added the reference number to this application. | ||
</p> | ||
<p class="govuk-body">If you have a UK ENIC reference number, you should add it to your qualifications details.</p> | ||
<p class="govuk-body">If you are still waiting then you can <%= govuk_link_to('save this application as a draft', candidate_interface_course_choices_course_review_path(current_application.id)) %> and come back to add your UK ENIC reference number later.</p> | ||
<p class="govuk-body">You can also submit your application without the UK ENIC reference number and contact the training provider when it arrives.</p> | ||
</div> | ||
|
||
<div class="govuk-button-group app-course-choice__confirm-submission"> | ||
<%= govuk_button_to('Enter a UK ENIC number', candidate_interface_continuous_applications_details_path, method: :get) %> | ||
<%= govuk_link_to('Continue without adding a UK ENIC number', candidate_interface_course_choices_course_review_and_submit_path(@application_choice.id)) %> | ||
</div> | ||
</div> | ||
</div> |
10 changes: 10 additions & 0 deletions
10
app/views/candidate_interface/course_choices/review_enic_interruption/show.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<% content_for :title, t('page_titles.application_review_and_submit', provider_name: @application_choice.provider.name) %> | ||
<% content_for(:before_content, govuk_back_link_to(candidate_interface_continuous_applications_choices_path)) %> | ||
|
||
<% if current_application.qualifications_enic_reasons_waiting_or_maybe? %> | ||
<%= render 'waiting_maybe' %> | ||
<% end %> | ||
|
||
<% if current_application.any_qualification_enic_reason_not_needed? %> | ||
<%= render 'not_needed' %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
123 changes: 123 additions & 0 deletions
123
...ate_interface/submitting/candidate_submitting_application_wiith_enic_interruption_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
require 'rails_helper' | ||
|
||
RSpec.describe 'Candidate submits the application with enic interruption pages' do | ||
include CandidateHelper | ||
include SignInHelper | ||
|
||
scenario 'Candidate submits an application with all applications having an enic_reason of not_needed', :js do | ||
given_i_am_signed_in | ||
|
||
when_i_have_completed_my_application_and_have_added_primary_as_a_course_choice_with_not_needed_qualification | ||
and_i_continue_with_my_application | ||
|
||
when_i_save_as_draft | ||
and_i_am_redirected_to_the_application_dashboard | ||
and_my_application_is_still_unsubmitted | ||
and_i_continue_with_my_application | ||
|
||
when_i_click_to_review_my_application | ||
then_i_see_a_interruption_page_for_personal_statement | ||
when_i_continue_without_editing | ||
then_i_see_a_interruption_page_for_not_needed_enic | ||
then_the_viewed_enic_interruption_page_cookie_to_be_set | ||
end | ||
|
||
scenario 'Candidate submits an application with an application having an enic_reason of maybe', :js do | ||
given_i_am_signed_in | ||
|
||
when_i_have_completed_my_application_and_have_added_primary_as_a_course_choice_with_waiting_or_maybe_qualification | ||
and_i_continue_with_my_application | ||
|
||
when_i_save_as_draft | ||
and_i_am_redirected_to_the_application_dashboard | ||
and_my_application_is_still_unsubmitted | ||
and_i_continue_with_my_application | ||
|
||
when_i_click_to_review_my_application | ||
then_i_see_a_interruption_page_for_personal_statement | ||
when_i_continue_without_editing | ||
then_i_see_a_interruption_page_for_waiting_or_maybe_enic | ||
then_the_viewed_enic_interruption_page_cookie_to_be_set | ||
end | ||
|
||
def when_i_have_completed_my_application_and_have_added_primary_as_a_course_choice_with_not_needed_qualification | ||
given_i_have_a_primary_course_choice(application_form_completed: true) | ||
add_not_needed_qualification | ||
end | ||
|
||
def when_i_have_completed_my_application_and_have_added_primary_as_a_course_choice_with_waiting_or_maybe_qualification | ||
given_i_have_a_primary_course_choice(application_form_completed: true) | ||
add_waiting_or_maybe_qualification | ||
end | ||
|
||
def given_i_have_a_primary_course_choice(application_form_completed:) | ||
completed_section_trait = application_form_completed.present? ? :completed : :minimum_info | ||
|
||
@provider = create(:provider, name: 'Gorse SCITT', code: '1N1') | ||
site = create( | ||
:site, | ||
name: 'Main site', | ||
code: '-', | ||
provider: @provider, | ||
address_line1: 'Gorse SCITT', | ||
address_line2: 'C/O The Bruntcliffe Academy', | ||
address_line3: 'Bruntcliffe Lane', | ||
address_line4: 'MORLEY, lEEDS', | ||
postcode: 'LS27 0LZ', | ||
) | ||
@course = create(:course, :open, name: 'Primary', code: '2XT2', provider: @provider) | ||
@course_option = create(:course_option, site:, course: @course) | ||
current_candidate.application_forms.delete_all | ||
current_candidate.application_forms << build(:application_form, completed_section_trait, becoming_a_teacher: 'I want to teach') | ||
@application_choice = create(:application_choice, :unsubmitted, course_option: @course_option, application_form: current_candidate.current_application) | ||
end | ||
|
||
def add_not_needed_qualification | ||
@application_choice.application_form.application_qualifications << build(:application_qualification, enic_reason: 'not_needed') | ||
end | ||
|
||
def add_waiting_or_maybe_qualification | ||
@application_choice.application_form.application_qualifications << build(:application_qualification, enic_reason: 'maybe') | ||
end | ||
|
||
def when_i_save_as_draft | ||
click_link_or_button 'Save as draft' | ||
end | ||
|
||
def and_my_application_is_still_unsubmitted | ||
expect(@application_choice.reload).to be_unsubmitted | ||
end | ||
|
||
def and_i_am_redirected_to_the_application_dashboard | ||
expect(page).to have_content t('page_titles.application_dashboard') | ||
expect(page).to have_content 'Gorse SCITT' | ||
end | ||
|
||
def when_i_go_back | ||
click_link_or_button 'Back' | ||
end | ||
|
||
def then_i_see_a_interruption_page_for_personal_statement | ||
expect(page).to have_content 'Your personal statement is 4 words.' | ||
end | ||
|
||
def then_i_see_a_interruption_page_for_not_needed_enic | ||
expect(page).to have_content 'You have not included a UK ENIC reference number' | ||
expect(page).to have_content 'Including a UK ENIC reference number in your application makes youn around 30% more likely to receive an offer.' | ||
expect(page).to have_current_path( | ||
candidate_interface_course_choices_course_review_enic_interruption_path(@application_choice.id), | ||
) | ||
end | ||
|
||
def then_i_see_a_interruption_page_for_waiting_or_maybe_enic | ||
expect(page).to have_content 'You have not included a UK ENIC reference number' | ||
expect(page).to have_content 'If you have a UK ENIC reference number, you should add it to your qualifications details.' | ||
expect(page).to have_current_path( | ||
candidate_interface_course_choices_course_review_enic_interruption_path(@application_choice.id), | ||
) | ||
end | ||
|
||
def then_the_viewed_enic_interruption_page_cookie_to_be_set | ||
expect(page.driver.browser.manage.cookie_named('viewed_enic_interruption_page')[:value]).to eq('true') | ||
end | ||
end |