aboutsummaryrefslogtreecommitdiffstats
path: root/spec/tasks/reflex_rake_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/tasks/reflex_rake_spec.rb')
-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