File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -59,7 +59,6 @@ RESEED_API_KEY=changeme
5959ENABLE_IMMEDIATE_SCHOOL_ONBOARDING = true
6060
6161# Salesforce Connect
62- SALESFORCE_ENABLED = true
6362SALESFORCE_CONNECT_HOST = salesforce_connect
6463SALESFORCE_CONNECT_PORT = 4101
6564SALESFORCE_CONNECT_DB = salesforce_development
Original file line number Diff line number Diff line change @@ -27,8 +27,7 @@ class SkipBecauseSalesforceIsDisabled < StandardError
2727 queue_as :salesforce_sync
2828
2929 before_perform do |_job |
30- salesforce_enabled = ENV . fetch ( 'SALESFORCE_ENABLED' , 'true' ) == 'true'
31- raise SkipBecauseSalesforceIsDisabled , 'SALESFORCE_ENABLED is not true.' unless salesforce_enabled
30+ raise SkipBecauseSalesforceIsDisabled , 'salesforce_sync Flipper flag is not enabled.' unless Flipper . enabled? ( :salesforce_sync )
3231 end
3332
3433 def perform ( *)
Original file line number Diff line number Diff line change 55RSpec . describe Salesforce ::ContactSyncJob do
66 subject ( :perform_job ) { described_class . perform_now ( school_id : school . id ) }
77
8+ before { Flipper . enable ( :salesforce_sync ) }
9+
810 let ( :school ) { create ( :school , creator_agree_to_ux_contact : true ) }
911 let! ( :sf_contact ) { create ( :salesforce_contact , pi_accounts_unique_id__c : school . creator_id ) }
1012
4143 end
4244 end
4345
44- context 'when SALESFORCE_ENABLED is false' do
45- around do |example |
46- ClimateControl . modify ( SALESFORCE_ENABLED : 'false' ) do
47- example . run
48- end
49- end
46+ context 'when the salesforce_sync Flipper flag is disabled' do
47+ before { Flipper . disable ( :salesforce_sync ) }
5048
5149 it 'discards the job without syncing' do
5250 sf_contact . update! ( experiencecsagreetouxcontact__c : false )
Original file line number Diff line number Diff line change 55RSpec . describe Salesforce ::RoleSyncJob do
66 subject ( :perform_job ) { described_class . perform_now ( role_id : role . id ) }
77
8+ before { Flipper . enable ( :salesforce_sync ) }
9+
810 let ( :role ) { create ( :role ) }
911
1012 context 'when the job has run' do
4345 end
4446 end
4547
46- context 'when SALESFORCE_ENABLED is false' do
47- around do |example |
48- ClimateControl . modify ( SALESFORCE_ENABLED : 'false' ) do
49- example . run
50- end
51- end
48+ context 'when the salesforce_sync Flipper flag is disabled' do
49+ before { Flipper . disable ( :salesforce_sync ) }
5250
5351 it 'discards the job without syncing' do
5452 perform_job
Original file line number Diff line number Diff line change 55RSpec . describe Salesforce ::SchoolSyncJob do
66 subject ( :perform_job ) { described_class . perform_now ( school_id : school . id ) }
77
8+ before { Flipper . enable ( :salesforce_sync ) }
9+
810 let ( :school ) { create ( :school ) }
911
1012 context 'when the job has run' do
6264 end
6365 end
6466
65- context 'when SALESFORCE_ENABLED is false' do
66- around do |example |
67- ClimateControl . modify ( SALESFORCE_ENABLED : 'false' ) do
68- example . run
69- end
70- end
67+ context 'when the salesforce_sync Flipper flag is disabled' do
68+ before { Flipper . disable ( :salesforce_sync ) }
7169
7270 it 'discards the job without syncing' do
7371 perform_job
You can’t perform that action at this time.
0 commit comments