Sha256: ee6657417666fb78f3b6b03152cc541894363f0dbcc02f529bff4773f69f7f06

Contents?: true

Size: 1.52 KB

Versions: 7

Compression:

Stored size: 1.52 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe TripLeg do
  
  before do
  end

  it "actual take off date_time dates are after dept_date_act_gmt if take off time is less than depart time" do
    dept_date_act_gmt = Date.new(1900,1,1)
    tl = TripLeg.new(:dept_date_act_gmt=>dept_date_act_gmt.to_fos_days,:t_o_time_act_gmt=>20,:dept_time_act_gmt=>1420)
    tl.actual_takeoff_date_time_gmt.should == DateTime.new(1900,1,2,0,20,0)
  end

 it "actual take off date_time dates are the same as dept_date_act_gmt if take off time is not less than depart time" do
    dept_date_act_gmt = Date.new(1900,1,1)
    tl = TripLeg.new(:dept_date_act_gmt=>dept_date_act_gmt.to_fos_days,:t_o_time_act_gmt=>40,:dept_time_act_gmt=>20)
    tl.actual_takeoff_date_time_gmt.should == DateTime.new(1900,1,1,0,40,0)
 end

  it "actual landing date_time dates are before arr_date_act_gmt if on time time is greater than landing time" do
    arr_date_act_gmt = Date.new(1900,1,2)
    tl = TripLeg.new(:arrival_date_gmt=>arr_date_act_gmt.to_fos_days,:land_time_act_gmt=>1420,:arriv_time_act_gmt=>20)
    tl.actual_land_date_time_gmt.should == DateTime.new(1900,1,1,23,40,0)
  end

  it "actual landing date_time dates are the same as arr_date_act_gmt if on time time is not greater than landing time" do
    arr_date_act_gmt = Date.new(1900,1,2)
    tl = TripLeg.new(:arrival_date_gmt=>arr_date_act_gmt.to_fos_days,:land_time_act_gmt=>20,:arriv_time_act_gmt=>40)
    tl.actual_land_date_time_gmt.should == DateTime.new(1900,1,2,0,20,0)
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
fossil-0.3.30 spec/models/trip_leg_spec.rb
fossil-0.3.29 spec/models/trip_leg_spec.rb
fossil-0.3.28 spec/models/trip_leg_spec.rb
fossil-0.3.27 spec/models/trip_leg_spec.rb
fossil-0.3.26 spec/models/trip_leg_spec.rb
fossil-0.3.25 spec/models/trip_leg_spec.rb
fossil-0.3.24 spec/models/trip_leg_spec.rb