Skip to content

Commit 8ac2fb7

Browse files
committed
Add tests around feature flag
1 parent 4deca60 commit 8ac2fb7

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

spec/models/teacher_invitation_spec.rb

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,22 @@
1818
expect(invitation).not_to be_valid
1919
end
2020

21-
it 'is valid with an unverified school' do
22-
school = build(:school, verified_at: nil)
23-
invitation = build(:teacher_invitation, school:)
21+
it 'is valid with an unverified school and immediate_school_onboarding is TRUE' do
22+
ClimateControl.modify(ENABLE_IMMEDIATE_SCHOOL_ONBOARDING: 'true') do
23+
school = build(:school, verified_at: nil)
24+
invitation = build(:teacher_invitation, school:)
2425

25-
expect(invitation).to be_valid
26+
expect(invitation).to be_valid
27+
end
28+
end
29+
30+
it 'is invalid with an unverified school and immediate_school_onboarding is FALSE' do
31+
ClimateControl.modify(ENABLE_IMMEDIATE_SCHOOL_ONBOARDING: 'false') do
32+
school = build(:school, verified_at: nil)
33+
invitation = build(:teacher_invitation, school:)
34+
35+
expect(invitation).not_to be_valid
36+
end
2637
end
2738

2839
it 'sends an invitation email after create' do

0 commit comments

Comments
 (0)