aboutsummaryrefslogtreecommitdiffstats
path: root/spec/tasks
diff options
context:
space:
mode:
authorXinhui2016-08-31 11:03:22 +0200
committerXinhui2016-08-31 11:03:22 +0200
commitd71549685f124fd895b01884f7d236cf09b96e85 (patch)
treeb1e0ab628872ad133ed594c56f369cf05c15080d /spec/tasks
parent98debbeaac00dbf1aa2c752521d5878776c540dc (diff)
downloadchouette-core-d71549685f124fd895b01884f7d236cf09b96e85.tar.bz2
Wip sync reflex - add gem - task reflex:sync + whenever cfg
Diffstat (limited to 'spec/tasks')
-rw-r--r--spec/tasks/reflex_rake_spec.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/tasks/reflex_rake_spec.rb b/spec/tasks/reflex_rake_spec.rb
new file mode 100644
index 000000000..63d27fca5
--- /dev/null
+++ b/spec/tasks/reflex_rake_spec.rb
@@ -0,0 +1,21 @@
+require 'spec_helper'
+
+describe 'test' do
+ before(:all) do
+ ['getOP', 'getOR'].each do |method|
+ stub_request(:get, "https://reflex.stif.info/ws/reflex/V1/service=getData/?format=xml&idRefa=0&method=#{method}").
+ to_return(body: File.open("#{fixture_path}/reflex.zip"), status: 200)
+ end
+ end
+
+ context 'process stop area sync' do
+ it 'should return results on valid request' do
+ start = Time.now
+ # Must have a referential
+ create(:stop_area_referential, name: 'Reflex')
+
+ Stif::ReflexSynchronization.synchronize_stop_area
+ Rails.logger.debug "Reflex-api sync done in #{Time.now - start} seconds !"
+ end
+ end
+end