File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change 8888 let ( :next_trigger_time ) { 1 . day . from_now }
8989 let ( :weekly_next_trigger_time ) { 1 . day . from_now }
9090 let ( :monthly_next_trigger_time ) { 1 . day . from_now }
91- let ( :time_now ) { Time . now }
9291
9392 let ( :cron_parser ) { instance_double ( Fugit ::Cron ) }
9493
9594 before ( :each ) do
9695 allow ( Core ::ConnectorSettings ) . to receive ( :fetch_crawler_connectors ) . and_return ( connector_settings )
9796
98- allow ( subject ) . to receive ( :sync_triggered? ) . with ( connector_settings , Time . now ) . and_call_original
99- allow ( subject ) . to receive ( :custom_sync_triggered? ) . with ( connector_settings , Time . now ) . and_call_original
97+ allow ( subject ) . to receive ( :sync_triggered? ) . with ( connector_settings , Timecop . freeze ( Time . now ) ) . and_call_original
98+ allow ( subject ) . to receive ( :custom_sync_triggered? ) . with ( connector_settings , Timecop . freeze ( Time . now ) ) . and_call_original
10099 allow ( connector_settings ) . to receive ( :connector_status_allows_sync? ) . and_return ( true )
101100 allow ( connector_settings ) . to receive ( :sync_now? ) . and_return ( sync_now )
102101 allow ( connector_settings ) . to receive ( :full_sync_scheduling ) . and_return ( full_sync_scheduling )
138137 end
139138
140139 # it will return the first custom scheduling it encounters
141- Timecop . freeze ( Time . now ) do
142- it_behaves_like 'triggers' , :weekly_key
143- end
140+ it_behaves_like 'triggers' , :weekly_key
144141 end
145142
146143 context 'when base scheduling and all custom scheduling are enabled and require a sync' do
You can’t perform that action at this time.
0 commit comments