aboutsummaryrefslogtreecommitdiffstats
path: root/spec/workers
diff options
context:
space:
mode:
authorXinhui2016-09-29 16:17:13 +0200
committerXinhui2016-09-29 16:17:13 +0200
commita1fffa57564825303671c20e596f4fc944fbdd12 (patch)
treeefbfe652a11c48d4818a26b3686ca2f355e612d7 /spec/workers
parentcecd26452ce1cb2486d926421c1ae6360c973d1b (diff)
downloadchouette-core-a1fffa57564825303671c20e596f4fc944fbdd12.tar.bz2
Refactoring StopAreaReferentialSync
Refs #1710
Diffstat (limited to 'spec/workers')
-rw-r--r--spec/workers/stop_area_referential_sync_worker_spec.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/workers/stop_area_referential_sync_worker_spec.rb b/spec/workers/stop_area_referential_sync_worker_spec.rb
new file mode 100644
index 000000000..48b64e55e
--- /dev/null
+++ b/spec/workers/stop_area_referential_sync_worker_spec.rb
@@ -0,0 +1,19 @@
+require 'rails_helper'
+RSpec.describe StopAreaReferentialSyncWorker, type: :worker do
+ let!(:stop_area_referential_sync) { create :stop_area_referential_sync }
+
+ it 'should call reflex synchronize on worker perform' do
+ expect(Stif::ReflexSynchronization).to receive(:synchronize)
+ StopAreaReferentialSyncWorker.new.perform(stop_area_referential_sync.id)
+ end
+
+ it 'should update stop_area_referential_sync started_at on worker perform' do
+ StopAreaReferentialSyncWorker.new.perform(stop_area_referential_sync.id)
+ expect(stop_area_referential_sync.reload.started_at).not_to be_nil
+ end
+
+ it 'should update stop_area_referential_sync ended_at on worker perform success' do
+ StopAreaReferentialSyncWorker.new.perform(stop_area_referential_sync.id)
+ expect(stop_area_referential_sync.reload.started_at).not_to be_nil
+ end
+end