diff options
Diffstat (limited to 'spec/models')
| -rw-r--r-- | spec/models/chouette/vehicle_journey_spec.rb | 12 | 
1 files changed, 12 insertions, 0 deletions
| diff --git a/spec/models/chouette/vehicle_journey_spec.rb b/spec/models/chouette/vehicle_journey_spec.rb index 05560f9e3..5ab6378f9 100644 --- a/spec/models/chouette/vehicle_journey_spec.rb +++ b/spec/models/chouette/vehicle_journey_spec.rb @@ -983,6 +983,18 @@ describe Chouette::VehicleJourney, :type => :model do        expect(@target_4.departure_time).to eq @target_3.arrival_time      end +    context "with a stop across midnight" do +      before do +        @middle.update arrival_time: @start.departure_time + 11.hours, departure_time: @start.departure_time + 13.hours, departure_day_offset: 1, arrival_day_offset: 0 +      end + +      it "should set the following stop day offset" do +        @journey.reload.fill_passing_times! +        expect(@target_3.reload.arrival_day_offset).to eq 1 +        expect(@target_3.departure_day_offset).to eq 1 +      end +    end +      context "with a day offset" do        before do          @end.update arrival_time: offset_passing_time(@middle.departure_time, - 4.hours), departure_time: offset_passing_time(@middle.departure_time, - 4.hours), departure_day_offset: 1, arrival_day_offset: 1 | 
