File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 8282 expect ( Sentry ) . to have_received ( :capture_exception ) . with ( kind_of ( StandardError ) )
8383 end
8484 end
85+
86+ describe 'when immediate onboarding is enabled' do
87+ # TODO: Remove this block once the feature flag is retired
88+ around do |example |
89+ ClimateControl . modify ( ENABLE_IMMEDIATE_SCHOOL_ONBOARDING : 'true' ) do
90+ example . run
91+ end
92+ end
93+
94+ let ( :onboarding_service ) { instance_spy ( SchoolOnboardingService , onboard : true ) }
95+
96+ before do
97+ allow ( SchoolOnboardingService ) . to receive ( :new ) . and_return ( onboarding_service )
98+ end
99+
100+ it 'calls the onboarding service' do
101+ described_class . call ( school_params :, creator_id :, token :)
102+ expect ( onboarding_service ) . to have_received ( :onboard ) . with ( token :)
103+ end
104+ end
105+
106+ # TODO: Remove these examples once the feature flag is retired
107+ describe 'when immediate onboarding is disabled' do
108+ around do |example |
109+ ClimateControl . modify ( ENABLE_IMMEDIATE_SCHOOL_ONBOARDING : nil ) do
110+ example . run
111+ end
112+ end
113+
114+ let ( :onboarding_service ) { instance_spy ( SchoolOnboardingService ) }
115+
116+ before do
117+ allow ( SchoolOnboardingService ) . to receive ( :new ) . and_return ( onboarding_service )
118+ end
119+
120+ it 'does not call the onboarding service' do
121+ described_class . call ( school_params :, creator_id :, token :)
122+ expect ( onboarding_service ) . not_to have_received ( :onboard )
123+ end
124+ end
85125end
You can’t perform that action at this time.
0 commit comments