Sha256: 0b53a9c71c3cf56d5316b16d26f7455aad45decdb9d652f66d6a590e0942a3e7

Contents?: true

Size: 1.21 KB

Versions: 2

Compression:

Stored size: 1.21 KB

Contents

require 'spec_helper'
require 'earth/air/flight_segment'

describe FlightSegment do
  before :all do
    FlightSegment.auto_upgrade!
  end
  
  describe 'import', :data_miner => true do
    before do
      require 'earth/air/flight_segment/data_miner'
    end
    
    it 'should import data' do
      FlightSegment.run_data_miner!
      FlightSegment.all.count.should == 1_149_003
    end
  end
  
  describe "verify imported data", :sanity => true do
    it "should have year from 2009 to present" do
      FlightSegment.where("year IS NULL OR year < 2009 OR year > #{::Time.now.year}").count.should == 0
    end
    
    it "should have origin airport in airports" do
      # FIXME TODO
    end
    
    it "should have destination airport in airports" do
      # FIXME TODO
    end
    
    it "should have origin country iso code in countries" do
      # FIXME TODO
    end
    
    it "should have destination country iso code in countries" do
      # FIXME TODO
    end
    
    it "should have airline name" do
      FlightSegment.where(:airline_name => nil).count.should == 0
    end
    
    it "should have aircraft description" do
      FlightSegment.where(:aircraft_description => nil).count.should == 0
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
earth-0.11.18 spec/earth/air/flight_segment_spec.rb
earth-0.11.17 spec/earth/air/flight_segment_spec.rb