diff --git a/app/models/provider.rb b/app/models/provider.rb index f1ddc9ee092..c9018ee859b 100644 --- a/app/models/provider.rb +++ b/app/models/provider.rb @@ -62,6 +62,12 @@ def onboarded? provider_agreements.any? end + def selectable_school? + return false unless CycleTimetable.current_year >= 2025 + + super + end + def lacks_admin_users? courses.any? && !(provider_permissions.exists?(manage_users: true) && diff --git a/spec/models/provider_spec.rb b/spec/models/provider_spec.rb index 0acbff9f841..94b4ada5649 100644 --- a/spec/models/provider_spec.rb +++ b/spec/models/provider_spec.rb @@ -54,4 +54,20 @@ expect(described_class.with_courses).to eq([provider]) end end + + describe 'selectable_school?' do + let(:provider) { create(:provider, selectable_school: true) } + + context 'when Current Cycle is 2024', time: mid_cycle(2024) do + it 'is not selectable school' do + expect(provider).not_to be_selectable_school + end + end + + context 'when Current Cycle is greater than 2024', time: mid_cycle(2025) do + it 'is selectable school' do + expect(provider).to be_selectable_school + end + end + end end diff --git a/spec/system/candidate_interface/course_selection/candidate_selecting_a_course_with_multiple_sites_and_unselectable_school_spec.rb b/spec/system/candidate_interface/course_selection/candidate_selecting_a_course_with_multiple_sites_and_unselectable_school_spec.rb index 432fd841e11..4621f8646cb 100644 --- a/spec/system/candidate_interface/course_selection/candidate_selecting_a_course_with_multiple_sites_and_unselectable_school_spec.rb +++ b/spec/system/candidate_interface/course_selection/candidate_selecting_a_course_with_multiple_sites_and_unselectable_school_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -RSpec.describe 'Selecting a course with multiple sites when the provider is not selectable_school' do +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 diff --git a/spec/system/candidate_interface/course_selection/candidate_selecting_a_course_with_multiple_study_modes_sites_and_unselectable_school_spec.rb b/spec/system/candidate_interface/course_selection/candidate_selecting_a_course_with_multiple_study_modes_sites_and_unselectable_school_spec.rb index b44c4ed1450..af42418d503 100644 --- a/spec/system/candidate_interface/course_selection/candidate_selecting_a_course_with_multiple_study_modes_sites_and_unselectable_school_spec.rb +++ b/spec/system/candidate_interface/course_selection/candidate_selecting_a_course_with_multiple_study_modes_sites_and_unselectable_school_spec.rb @@ -3,7 +3,7 @@ RSpec.describe 'Selecting a course with multiple study modes and sites when the provider is not selectable_school' do include CandidateHelper - it 'Candidate skips the school selection' do + it 'Candidate skips the school selection', time: CycleTimetableHelper.mid_cycle(2025) do given_i_am_signed_in and_there_are_course_options