Skip to content

Commit d97bfdc

Browse files
committed
Make tests run for now until we better understand the tests around sync_triggered? and custom_sync_triggered?
1 parent 12ff1e9 commit d97bfdc

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

spec/connectors/crawler/crawler_scheduler_spec.rb

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,14 @@
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)
@@ -138,9 +137,7 @@
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

0 commit comments

Comments
 (0)