diff options
| author | Vlatka Pavisic | 2017-02-14 12:05:46 +0100 |
|---|---|---|
| committer | Vlatka Pavisic | 2017-02-14 12:05:57 +0100 |
| commit | 6c6f0def73a6228a48f8f3ccdcd62a99e6332798 (patch) | |
| tree | be1044f483cad0de6b308882a50fefbf33deb2a2 | |
| parent | 5aa6e1cf6333b2d2c854bf182b07f463168a421c (diff) | |
| download | chouette-core-6c6f0def73a6228a48f8f3ccdcd62a99e6332798.tar.bz2 | |
Refs #2596 : Fix tests pt. 2
| -rw-r--r-- | app/models/vehicle_translation.rb | 7 | ||||
| -rw-r--r-- | lib/stif/reflex_synchronization.rb | 2 | ||||
| -rw-r--r-- | spec/models/vehicle_translation_spec.rb | 4 |
3 files changed, 7 insertions, 6 deletions
diff --git a/app/models/vehicle_translation.rb b/app/models/vehicle_translation.rb index 76d679c30..37598eece 100644 --- a/app/models/vehicle_translation.rb +++ b/app/models/vehicle_translation.rb @@ -61,8 +61,10 @@ class VehicleTranslation def translate copied_attributes = vehicle_journey.attributes - copied_attributes.delete( "id") - copied_attributes.delete( "objectid") + copied_attributes.delete "id" + copied_attributes.delete "objectid" + copied_attributes.delete "created_at" + copied_attributes.delete "updated_at" # time shift for current duplicated vehicle delta = first_delta @@ -77,7 +79,6 @@ class VehicleTranslation vjas_attributes.delete( "id" ) vjas_attributes.merge! "departure_time" => ( vjas_attributes[ "departure_time"] + delta), "arrival_time" => ( vjas_attributes[ "arrival_time"] + delta) - Chouette::VehicleJourneyAtStop.create( vjas_attributes) end delta += duration.to_i.minutes diff --git a/lib/stif/reflex_synchronization.rb b/lib/stif/reflex_synchronization.rb index 9c5ff7cd4..b7295070a 100644 --- a/lib/stif/reflex_synchronization.rb +++ b/lib/stif/reflex_synchronization.rb @@ -156,7 +156,7 @@ module Stif end if stop.changed? - stop.creation_time = entry[:created] + stop.created_at = entry[:created] stop.import_xml = entry[:xml] prop = stop.new_record? ? :imported_count : :updated_count increment_counts prop, 1 diff --git a/spec/models/vehicle_translation_spec.rb b/spec/models/vehicle_translation_spec.rb index da24ebc38..c9a573ae2 100644 --- a/spec/models/vehicle_translation_spec.rb +++ b/spec/models/vehicle_translation_spec.rb @@ -76,8 +76,8 @@ describe VehicleTranslation, :type => :model do subject.translate expect(last_created_vehicle.vehicle_journey_at_stops.count).to eq(vehicle_journey.vehicle_journey_at_stops.count) end - #todo : fix - xit "should add vehicle where vehicle_journey_at_stops are translated with #duration" do + + it "should add vehicle journey where vehicle_journey_at_stops are translated with #duration" do read_vehicle = Chouette::VehicleJourney.find(vehicle_journey.id) # read from bd, change time values delta = subject.first_delta subject.translate |
