-
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.
Merge pull request #9849 from DFE-Digital/2299-tda-manage-dont-allow-…
…providers-to-set-ske-conditions-when-making-an-offer-to-undergraduate-apps Make sure you can't offer SKE to undergraduate candidates
- Loading branch information
Showing
3 changed files
with
97 additions
and
1 deletion.
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
72 changes: 72 additions & 0 deletions
72
spec/system/provider_interface/make_offer_for_undergraduate_application_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,72 @@ | ||
require 'rails_helper' | ||
|
||
RSpec.describe 'Provider makes an offer on undergraduate applications' do | ||
include DfESignInHelpers | ||
include ProviderUserPermissionsHelper | ||
include OfferStepsHelper | ||
let(:provider) { @provider } | ||
let(:ratifying_provider) { @provider } | ||
let(:provider_user) { @provider_user } | ||
let(:application_choice) { @application_choice } | ||
|
||
scenario 'Making an offer for the requested course option' do | ||
given_there_is_an_undergraduate_application | ||
and_the_course_subject_requires_ske | ||
and_i_am_a_provider_user | ||
and_i_am_permitted_to_make_decisions_for_my_provider | ||
and_i_sign_in_to_the_provider_interface | ||
|
||
and_the_provider_user_can_offer_multiple_provider_courses | ||
when_i_visit_the_provider_interface | ||
and_i_click_an_application_choice_awaiting_decision | ||
and_i_click_on_make_decision | ||
then_i_see_the_decision_page | ||
|
||
when_i_choose_to_make_an_offer | ||
then_the_ske_questions_are_skipped | ||
then_the_conditions_page_is_loaded | ||
and_the_default_conditions_are_checked | ||
|
||
when_i_add_further_conditions | ||
and_i_add_and_remove_another_condition | ||
and_i_click_continue | ||
then_the_review_page_is_loaded | ||
and_i_can_confirm_my_answers | ||
|
||
when_i_send_the_offer | ||
then_i_see_that_the_offer_was_successfuly_made | ||
end | ||
|
||
def given_there_is_an_undergraduate_application | ||
@provider_user = create(:provider_user, :with_dfe_sign_in) | ||
@provider = @provider_user.providers.first | ||
@ratifying_provider = create(:provider) | ||
course = build(:course, :teacher_degree_apprenticeship, provider: @provider, accredited_provider: @ratifying_provider) | ||
course_option = build(:course_option, course:) | ||
@application_choice = create(:application_choice, :awaiting_provider_decision, course_option:) | ||
end | ||
|
||
def and_the_course_subject_requires_ske | ||
@application_choice.course_option.course.subjects.delete_all | ||
@application_choice.course_option.course.subjects << build( | ||
:subject, code: 'F1', name: 'Chemistry' | ||
) | ||
end | ||
|
||
def and_i_am_a_provider_user | ||
user_exists_in_dfe_sign_in(email_address: @provider_user.email_address) | ||
end | ||
|
||
def and_the_provider_user_can_offer_multiple_provider_courses | ||
create( | ||
:provider_relationship_permissions, | ||
training_provider: @provider, | ||
ratifying_provider: @ratifying_provider, | ||
ratifying_provider_can_make_decisions: true, | ||
) | ||
end | ||
|
||
def then_the_ske_questions_are_skipped | ||
expect(page).to have_no_content('SKE') | ||
end | ||
end |