diff --git a/spec/wizards/placements/add_placement/steps/additional_subjects_spec.rb b/spec/wizards/placements/add_placement/steps/additional_subjects_spec.rb index 4e0b9bcfc..20f511b5f 100644 --- a/spec/wizards/placements/add_placement/steps/additional_subjects_spec.rb +++ b/spec/wizards/placements/add_placement/steps/additional_subjects_spec.rb @@ -9,10 +9,16 @@ it { is_expected.to validate_presence_of(:school) } it { is_expected.to validate_presence_of(:parent_subject_id) } - describe "#additional_subjects_valid" do + describe "additional subjects validation" do let(:school) { create(:placements_school) } let(:parent_subject) { create(:subject) } + it "is invalid if the parent subject is present and additional subjects are blank" do + step = described_class.new(school:, parent_subject_id: parent_subject.id) + + expect(step).to be_invalid + end + it "is invalid if the additional subject does not exist" do child_subject = create(:subject, parent_subject:) step = described_class.new(school:, parent_subject_id: parent_subject.id, additional_subject_ids: ["not_a_subject", child_subject.id])