generated from DFE-Digital/govuk-rails-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Skip start term step in next cohort registration period
When a participant has no induction start date from DQT and the current date is within the registration window for the next cohort, automatically assign them.
- Loading branch information
Showing
20 changed files
with
180 additions
and
176 deletions.
There are no files selected for viewing
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
64 changes: 0 additions & 64 deletions
64
app/forms/schools/add_participants/wizard_steps/start_term_step.rb
This file was deleted.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.
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
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
83 changes: 83 additions & 0 deletions
83
...es/schools/participants/add_participants/sit_add_ect_without_induction_start_date_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,83 @@ | ||
# frozen_string_literal: true | ||
|
||
require "rails_helper" | ||
require_relative "../../training_dashboard/manage_training_steps" | ||
|
||
RSpec.describe "SIT adds ECT participant", js: true do | ||
include ManageTrainingSteps | ||
|
||
before do | ||
inside_registration_window do | ||
set_participant_data | ||
given_there_is_a_school_that_has_chosen_fip_for_current_and_next_cohorts_and_partnered | ||
and_i_am_signed_in_as_an_induction_coordinator | ||
and_i_click_on(Cohort.current.description) | ||
then_i_am_taken_to_fip_induction_dashboard | ||
|
||
set_dqt_validation_result | ||
end | ||
end | ||
|
||
scenario "Participant doesn't have an induction start date" do | ||
inside_registration_window do | ||
when_i_navigate_to_ect_dashboard | ||
when_i_click_to_add_a_new_ect | ||
then_i_should_be_on_the_who_to_add_page | ||
|
||
when_i_select_to_add_a "ECT" | ||
when_i_click_on_continue | ||
|
||
then_i_am_taken_to_the_what_we_need_from_you_page | ||
|
||
when_i_click_on_continue | ||
then_i_am_taken_to_add_ect_name_page | ||
|
||
when_i_add_ect_name | ||
when_i_click_on_continue | ||
then_i_am_taken_to_add_teachers_trn_page | ||
|
||
when_i_add_the_trn | ||
when_i_click_on_continue | ||
then_i_am_taken_to_add_date_of_birth_page | ||
|
||
when_i_add_a_date_of_birth | ||
when_i_click_on_continue | ||
then_i_am_taken_to_add_ect_or_mentor_email_page | ||
|
||
when_i_add_ect_or_mentor_email(email: @participant_data[:email]) | ||
when_i_click_on_continue | ||
|
||
when_i_click_confirm_and_add | ||
then_i_am_taken_to_the_confirmation_page | ||
and_the_participant_has_been_added_to_the_next_cohort | ||
end | ||
end | ||
|
||
def given_there_is_a_school_that_has_chosen_fip_for_current_and_next_cohorts_and_partnered | ||
given_there_is_a_school_that_has_chosen_fip_for_previous_and_current_cohort_and_partnered | ||
@cohort_next = Cohort.next || create(:cohort, :next) | ||
@school_cohort_next = create(:school_cohort, :fip, school: @school, cohort: @cohort_next) | ||
@induction_programme_next = create(:induction_programme, :fip, school_cohort: @school_cohort_next, partnership: @partnership_current) | ||
@school_cohort_next.update!(default_induction_programme: @induction_programme_next) | ||
end | ||
|
||
def then_i_am_taken_to_the_confirmation_page | ||
expect(page).to have_content("#{@participant_data[:full_name]} has been added as an ECT") | ||
end | ||
|
||
def and_the_participant_has_been_added_to_the_next_cohort | ||
expect(@school.ecf_participant_profiles.last.school_cohort).to eq(@school_cohort_next) | ||
end | ||
|
||
def set_participant_data | ||
@participant_data = { | ||
trn: "1234567", | ||
full_name: "Sally Teacher", | ||
date_of_birth: Date.new(1998, 3, 22), | ||
email: "[email protected]", | ||
nino: "AB123456A", | ||
start_date: nil, | ||
start_term: nil, | ||
} | ||
end | ||
end |
Oops, something went wrong.