aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorXinhui2016-08-31 17:21:13 +0200
committerXinhui2016-08-31 17:21:13 +0200
commit5b80c096c66ed30910f8dfa326f864f050c3a40c (patch)
tree89b607502599dee3e1fc7aacad2a04b0de05f2b7 /spec
parenta71d5b8ff5804094bcbe1c945ad8fde02ba7f9f0 (diff)
downloadchouette-core-5b80c096c66ed30910f8dfa326f864f050c3a40c.tar.bz2
Rspec reflex:sync
Diffstat (limited to 'spec')
-rw-r--r--spec/tasks/reflex_rake_spec.rb17
1 files changed, 7 insertions, 10 deletions
diff --git a/spec/tasks/reflex_rake_spec.rb b/spec/tasks/reflex_rake_spec.rb
index 2f5d0b709..f1dc25bc8 100644
--- a/spec/tasks/reflex_rake_spec.rb
+++ b/spec/tasks/reflex_rake_spec.rb
@@ -1,6 +1,6 @@
require 'spec_helper'
-describe 'test' do
+describe 'reflex:sync' 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}").
@@ -8,14 +8,11 @@ describe 'test' do
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
- Rails.logger.debug "Reflex-api sync done in #{Time.now - start} seconds !"
- end
+ it 'should create stopArea on successfull request' do
+ # Must have an stop_area_referential
+ create(:stop_area_referential, name: 'Reflex')
+ Stif::ReflexSynchronization.synchronize
+ expect(Chouette::StopArea.count).to eq 7928
+ expect(Chouette::AccessPoint.count).to eq 60
end
end