-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Skip school selection in CourseSelection based on Provider#selectable_school
#9758
Merged
inulty-dfe
merged 6 commits into
main
from
2217-skip-school-selection-in-courseselection-based-on-providerselectable-school
Sep 2, 2024
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
6340550
Avoid instantiating next_step to check for edit path
inulty-dfe 7e92b12
Skip school select in Course Selection journey unless selectable_school
inulty-dfe 9ed730e
Make providers all selectable_school in specs
inulty-dfe 3f0ff08
Add specs for unselectable school
inulty-dfe af34e30
Defer Provider#selectable_school? until 2025 recruitment cycle
inulty-dfe dd18845
Add comment explaining next_edit_step_path method
inulty-dfe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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
93 changes: 93 additions & 0 deletions
93
...election/candidate_selecting_a_course_with_multiple_sites_and_unselectable_school_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,93 @@ | ||
require 'rails_helper' | ||
|
||
RSpec.describe 'Selecting a course with multiple sites when the provider is not selectable_school', time: CycleTimetableHelper.mid_cycle(2025) do | ||
include CandidateHelper | ||
|
||
it 'Candidate skips the school selection' do | ||
given_i_am_signed_in | ||
and_there_are_course_options | ||
|
||
when_i_visit_the_site | ||
and_i_click_on_course_choices | ||
|
||
and_i_choose_that_i_know_where_i_want_to_apply | ||
and_i_click_continue | ||
and_i_choose_a_provider | ||
and_i_choose_a_course | ||
|
||
then_i_am_on_the_application_choice_review_page | ||
end | ||
|
||
def given_i_am_signed_in | ||
create_and_sign_in_candidate | ||
end | ||
|
||
def when_i_visit_the_site | ||
visit candidate_interface_continuous_applications_details_path | ||
end | ||
|
||
def and_i_click_on_course_choices | ||
click_link_or_button 'Your application' | ||
click_link_or_button 'Add application' | ||
end | ||
|
||
def and_i_choose_that_i_know_where_i_want_to_apply | ||
choose 'Yes, I know where I want to apply' | ||
and_i_click_continue | ||
end | ||
|
||
def when_i_choose_that_i_know_where_i_want_to_apply | ||
and_i_choose_that_i_know_where_i_want_to_apply | ||
end | ||
|
||
def and_i_choose_a_provider | ||
select 'Gorse SCITT (1N1)' | ||
click_link_or_button t('continue') | ||
end | ||
|
||
def and_i_choose_a_course | ||
choose 'Primary (2XT2)' | ||
click_link_or_button t('continue') | ||
end | ||
|
||
def when_i_click_continue | ||
click_link_or_button t('continue') | ||
end | ||
|
||
def and_i_click_continue | ||
when_i_click_continue | ||
end | ||
|
||
def application_choice | ||
current_candidate.current_application.application_choices.last | ||
end | ||
|
||
def and_there_are_course_options | ||
@provider = create(:provider, name: 'Gorse SCITT', code: '1N1', selectable_school: false) | ||
first_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', | ||
) | ||
second_site = create( | ||
:site, | ||
name: 'Harehills Primary School', | ||
code: '1', | ||
provider: @provider, | ||
address_line1: 'Darfield Road', | ||
address_line2: '', | ||
address_line3: 'Leeds', | ||
address_line4: 'West Yorkshire', | ||
postcode: 'LS8 5DQ', | ||
) | ||
@multi_site_course = create(:course, :open, :with_both_study_modes, name: 'Primary', code: '2XT2', provider: @provider) | ||
create(:course_option, site: first_site, course: @multi_site_course) | ||
create(:course_option, site: second_site, course: @multi_site_course) | ||
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bug fix.
We get silent exception.
When we try to instantiate the next step and call
next_step
on that (to know if there is a next step) we get errors about the params required to create the next - next step.This was originally designed to avoid having to list all the steps we know do not have a next step.
We now revert to doing that out of necessity. Description added to the commit message also.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally "terminal" or "editable" steps should have a property so we can identify them.
@tomas-stefano
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I try to read and read and I don't understand to be fair. 🤔
Let's huddle in the afternoon?