diff options
| author | Xinhui | 2017-07-28 10:34:35 +0200 | 
|---|---|---|
| committer | Xinhui | 2017-07-28 10:58:15 +0200 | 
| commit | 650aaa1ddfb79e84bb11714f97494968c9a1f193 (patch) | |
| tree | 8824b6d450e7dce93dae1e9f6f70b304dfd48084 | |
| parent | cc9ac5528aec175a136fc4aa5a7e5faa21e069b5 (diff) | |
| download | chouette-core-650aaa1ddfb79e84bb11714f97494968c9a1f193.tar.bz2 | |
Fix undefined method local_id for StifCodifligneAttributesSupport & StifReflexAttributesSupport
| -rw-r--r-- | app/models/concerns/stif_codifligne_attributes_support.rb | 2 | ||||
| -rw-r--r-- | app/models/concerns/stif_reflex_attributes_support.rb | 2 | ||||
| -rw-r--r-- | spec/factories/chouette_access_points.rb | 2 | ||||
| -rw-r--r-- | spec/factories/chouette_lines.rb | 2 | ||||
| -rw-r--r-- | spec/factories/chouette_stop_areas.rb | 2 | ||||
| -rw-r--r-- | spec/models/chouette/access_point_spec.rb | 9 | ||||
| -rw-r--r-- | spec/models/chouette/stop_area_spec.rb | 4 | 
7 files changed, 12 insertions, 11 deletions
| diff --git a/app/models/concerns/stif_codifligne_attributes_support.rb b/app/models/concerns/stif_codifligne_attributes_support.rb index d4370e505..0cd2cccc4 100644 --- a/app/models/concerns/stif_codifligne_attributes_support.rb +++ b/app/models/concerns/stif_codifligne_attributes_support.rb @@ -16,6 +16,6 @@ module StifCodifligneAttributesSupport    end    def objectid -    Chouette::StifCodifligneObjectid.new read_attribute(:objectid).to_s +    Chouette::StifCodifligneObjectid.new read_attribute(:objectid)    end  end diff --git a/app/models/concerns/stif_reflex_attributes_support.rb b/app/models/concerns/stif_reflex_attributes_support.rb index e6236a146..9dfd21f94 100644 --- a/app/models/concerns/stif_reflex_attributes_support.rb +++ b/app/models/concerns/stif_reflex_attributes_support.rb @@ -16,6 +16,6 @@ module StifReflexAttributesSupport    end    def objectid -    Chouette::StifReflexObjectid.new read_attribute(:objectid).to_s +    Chouette::StifReflexObjectid.new read_attribute(:objectid)    end  end diff --git a/spec/factories/chouette_access_points.rb b/spec/factories/chouette_access_points.rb index ef0247710..38ad76363 100644 --- a/spec/factories/chouette_access_points.rb +++ b/spec/factories/chouette_access_points.rb @@ -5,7 +5,7 @@ FactoryGirl.define do      longitude {10.0 * rand}      sequence(:name) { |n| "AccessPoint #{n}" }      access_type "InOut" -    sequence(:objectid) { |n| "test:AccessPoint:#{n}:STIF" } +    sequence(:objectid) { |n| "FR:#{n}:ADL:#{n}:STIF" }      association :stop_area, :factory => :stop_area    end diff --git a/spec/factories/chouette_lines.rb b/spec/factories/chouette_lines.rb index 24b182b83..423ab99f2 100644 --- a/spec/factories/chouette_lines.rb +++ b/spec/factories/chouette_lines.rb @@ -2,7 +2,7 @@ FactoryGirl.define do    factory :line, :class => Chouette::Line do      sequence(:name) { |n| "Line #{n}" } -    sequence(:objectid) { |n| "chouette:test:Line:#{n}" } +    sequence(:objectid) { |n| "STIF:CODIFLIGNE:Line:#{n}" }      sequence(:transport_mode) { |n| "bus" }      sequence(:number, 1) diff --git a/spec/factories/chouette_stop_areas.rb b/spec/factories/chouette_stop_areas.rb index 8e92b024b..8b64c227b 100644 --- a/spec/factories/chouette_stop_areas.rb +++ b/spec/factories/chouette_stop_areas.rb @@ -1,6 +1,6 @@  FactoryGirl.define do    factory :stop_area, :class => Chouette::StopArea do -    sequence(:objectid) { |n| "test:StopArea:#{n}" } +    sequence(:objectid) { |n| "FR:#{n}:ZDE:#{n}:STIF" }      sequence(:name) { |n| "stop_area_#{n}" }      sequence(:registration_number) { |n| "test-#{n}" }      area_type { Chouette::StopArea.area_type.values.sample } diff --git a/spec/models/chouette/access_point_spec.rb b/spec/models/chouette/access_point_spec.rb index 0251e9491..e0f4b1501 100644 --- a/spec/models/chouette/access_point_spec.rb +++ b/spec/models/chouette/access_point_spec.rb @@ -1,6 +1,7 @@  require 'spec_helper'  describe Chouette::AccessPoint, :type => :model do +  subject { create(:access_point) }    describe '#objectid' do      subject { super().objectid } @@ -109,7 +110,6 @@ describe Chouette::AccessPoint, :type => :model do    end    describe "#to_lat_lng" do -      it "should return nil if latitude is nil" do        subject.latitude = nil        expect(subject.to_lat_lng).to be_nil @@ -123,12 +123,13 @@ describe Chouette::AccessPoint, :type => :model do    end    describe "#geometry" do +    let(:access_point) { create(:access_point) }      it "should be nil when to_lat_lng is nil" do -      allow(subject).to receive_messages :to_lat_lng => nil -      expect(subject.geometry).to be_nil +      allow(access_point).to receive_messages :longitude => nil +      allow(access_point).to receive_messages :latitude => nil +      expect(access_point.geometry).to be_nil      end -    end    describe "#generic_access_link_matrix" do diff --git a/spec/models/chouette/stop_area_spec.rb b/spec/models/chouette/stop_area_spec.rb index 293ae5202..a3a398bfb 100644 --- a/spec/models/chouette/stop_area_spec.rb +++ b/spec/models/chouette/stop_area_spec.rb @@ -1,9 +1,9 @@  require 'spec_helper'  describe Chouette::StopArea, :type => :model do -  # FIXME !!!!!!!! +  subject { create(:stop_area) } +    let!(:quay) { create :stop_area, :area_type => "zdep" } -  # let!(:boarding_position) { create :stop_area, :area_type => "BoardingPosition" }    let!(:commercial_stop_point) { create :stop_area, :area_type => "lda" }    let!(:stop_place) { create :stop_area, :area_type => "zdlp" } | 
