Sha256: c3f2fce55e75714d3e1bcdc168978c1236794f1ef07a4d435dfb8cc753bc8f1d

Contents?: true

Size: 1.36 KB

Versions: 4

Compression:

Stored size: 1.36 KB

Contents

require 'earth/air/flight_segment'

FactoryGirl.define do
  factory :flight_segment, :class => FlightSegment do
    row_hash { "fake-#{rand(1e11)}" }

    trait(:from_lax) { origin_airport_iata_code 'LAX' }
    trait(:from_ord) { origin_airport_iata_code 'ORD' }

    trait(:from_los_angeles) { origin_airport_city 'Los Angeles' }
    trait(:from_chicago) { origin_airport_city 'Chicago' }
    
    trait(:to_sfo) { destination_airport_iata_code 'SFO' }
    trait(:to_msn) { destination_airport_iata_code 'MSN' }
    trait(:to_lax) { destination_airport_iata_code 'LAX' }
    trait(:to_ord) { destination_airport_iata_code 'ORD' }

    trait(:to_los_angeles) { destination_airport_city 'Los Angeles' }
    trait(:to_chicago) { destination_airport_city 'Chicago' }
    
    trait(:june_2010) { month 6; year 2010 }
    trait(:may_2011) { year 2011; month 5 }
    trait(:june_2011) { year 2011; month 6 }
    trait(:may_25_2011) { year 2011; month 5 }
    trait(:july_2011) { year 2011; month 7 }
    
    trait(:united) { airline_bts_code 'UA' }
    trait(:delta) { airline_bts_code 'DL' }
    trait(:lufthansa) { airline_bts_code 'LH' }
    trait(:united_icao) { airline_icao_code 'UAL' }
    trait(:delta_icao) { airline_icao_code 'DAL' }
    trait(:lufthansa_icao) { airline_icao_code 'DLH' }
    
    trait(:loaded) { load_factor 0.99 }
    trait(:empty) { load_factor 0.01 }
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
earth-1.1.0 spec/factories/flight_segment.rb
earth-1.0.3 spec/factories/flight_segment.rb
earth-1.0.2 spec/factories/flight_segment.rb
earth-1.0.1 spec/factories/flight_segment.rb