diff options
| author | Zog | 2018-05-28 15:25:04 +0200 | 
|---|---|---|
| committer | Zog | 2018-05-29 12:04:49 +0200 | 
| commit | 79e89af12bbc865b6defafa27dca5dafd72df3ef (patch) | |
| tree | 4cd82388e99a7fb60cbae9a347f9afc3d8f208d7 | |
| parent | 898bdeeaa22193d00c2ccea84f3d2377ebeb8e4f (diff) | |
| download | chouette-core-79e89af12bbc865b6defafa27dca5dafd72df3ef.tar.bz2 | |
Fix StopPoint#stop_area_light
| -rw-r--r-- | app/models/chouette/stop_point.rb | 2 | ||||
| -rw-r--r-- | spec/models/chouette/vehicle_journey_at_stop_spec.rb | 11 | 
2 files changed, 6 insertions, 7 deletions
| diff --git a/app/models/chouette/stop_point.rb b/app/models/chouette/stop_point.rb index 0f7c6a594..91dfab705 100644 --- a/app/models/chouette/stop_point.rb +++ b/app/models/chouette/stop_point.rb @@ -10,7 +10,7 @@ module Chouette      include ObjectidSupport      belongs_to :stop_area -    belongs_to :stop_area_light, -> {select(:name, :city_name, :zip_code, :time_zone, :registration_number)}, class_name: "Chouette::StopArea", foreign_key: :stop_area_id +    belongs_to :stop_area_light, -> {select(:name, :city_name, :zip_code, :time_zone, :registration_number, :kind, :area_type, :time_zone)}, class_name: "Chouette::StopArea", foreign_key: :stop_area_id      belongs_to :route, inverse_of: :stop_points      has_many :journey_patterns, through: :route      has_many :vehicle_journey_at_stops, :dependent => :destroy diff --git a/spec/models/chouette/vehicle_journey_at_stop_spec.rb b/spec/models/chouette/vehicle_journey_at_stop_spec.rb index ae9823243..05a772dac 100644 --- a/spec/models/chouette/vehicle_journey_at_stop_spec.rb +++ b/spec/models/chouette/vehicle_journey_at_stop_spec.rb @@ -1,10 +1,10 @@  require 'spec_helper'  RSpec.describe Chouette::VehicleJourneyAtStop, type: :model do -  subject { create(:vehicle_journey_at_stop) } +  subject { build_stubbed(:vehicle_journey_at_stop) }    describe 'checksum' do -    let(:at_stop) { build_stubbed(:vehicle_journey_at_stop) } +    subject(:at_stop) { create(:vehicle_journey_at_stop) }      it_behaves_like 'checksum support' @@ -43,7 +43,7 @@ RSpec.describe Chouette::VehicleJourneyAtStop, type: :model do    end    context "the different times" do -    let (:at_stop) { build_stubbed(:vehicle_journey_at_stop) } +    let (:at_stop) { create(:vehicle_journey_at_stop) }      describe "without a TimeZone" do        it "should not offset times" do @@ -52,11 +52,10 @@ RSpec.describe Chouette::VehicleJourneyAtStop, type: :model do        end      end -      describe "with a TimeZone" do        before(:each) do          stop = at_stop.stop_point.stop_area -        stop.time_zone = "Mexico City" +        stop.update time_zone: "Mexico City"        end        it "should offset times" do @@ -66,7 +65,7 @@ RSpec.describe Chouette::VehicleJourneyAtStop, type: :model do        context "with a wrong Timezone" do          before do -          at_stop.stop_point.stop_area.time_zone = "Gotham City" +          at_stop.stop_point.stop_area.update time_zone: "Gotham City"          end          it "should not offset times" do | 
