diff --git a/app/forms/schools/add_participants/base_wizard.rb b/app/forms/schools/add_participants/base_wizard.rb index d8223cb766..c037fc2cb4 100644 --- a/app/forms/schools/add_participants/base_wizard.rb +++ b/app/forms/schools/add_participants/base_wizard.rb @@ -467,8 +467,9 @@ def cohort_to_place_participant if transfer? existing_participant_cohort || existing_participant_profile&.schedule&.cohort elsif ect_participant? && induction_start_date.present? - Cohort.containing_date(induction_start_date).tap do |cohort| + Cohort.for_induction_start_date(induction_start_date).tap do |cohort| return Cohort.current if cohort.blank? || cohort.npq_plus_one_or_earlier? + return Cohort.active_registration_cohort if cohort.payments_frozen? end elsif Cohort.within_automatic_assignment_period? # true from 1/9 to end of automatic assignment period diff --git a/spec/models/cohort_spec.rb b/spec/models/cohort_spec.rb index b7e7a97301..cb83d3d5fb 100644 --- a/spec/models/cohort_spec.rb +++ b/spec/models/cohort_spec.rb @@ -3,7 +3,7 @@ require "rails_helper" RSpec.describe Cohort, type: :model do - let!(:cohort_2024) { FactoryBot.create :seed_cohort, start_year: 2024 } + let!(:cohort_2024) { Cohort.find_by_start_year(2024) } describe "associations" do it { is_expected.to have_many(:call_off_contracts) }