Sha256: e9b3151987783c900741dad53f7e2dd50ca92dda7e24cf2b62fcf8ed6cb0b1a2

Contents?: true

Size: 956 Bytes

Versions: 2

Compression:

Stored size: 956 Bytes

Contents

require 'spec_helper'
require 'earth/air/airport'

describe Airport do
  before :all do
    Airport.auto_upgrade!
  end
  
  describe "when importing data", :data_miner => true do
    before do
      require 'earth/air/airport/data_miner'
    end
    
    it "imports all airports" do
      Airport.run_data_miner!
      Airport.count.should == 5324
    end
  end
  
  describe "verify imported data", :sanity => true do
    it "should have name" do
      Airport.where(:name => nil).count.should == 0
    end
    
    it "should have city" do
      Airport.where(:city => nil).count.should == 0
    end
    
    it "should have country code" do
      Airport.where(:country_iso_3166_code => nil).count.should == 0
    end
    
    it "should have lat/lng" do
      Airport.where(:latitude => nil).count.should == 0
      Airport.where(:longitude => nil).count.should == 0
    end
    
    # FIXME TODO check for duplicate cities in same country
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

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