Sha256: 84df9284e67203187326c4794d9284c73168b94275a33840c64fe14b723942d2

Contents?: true

Size: 993 Bytes

Versions: 6

Compression:

Stored size: 993 Bytes

Contents

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

describe Airport do
  describe "when importing data", :data_miner => true do
    before do
      Earth.init :air, :load_data_miner => true, :skip_parent_associations => :true
    end
    
    it "imports all airports" do
      Airport.run_data_miner!
    end
  end
  
  describe "verify imported data", :sanity => true do
    it "should have all the data" do
      Airport.count.should == 5324
    end
    
    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

6 entries across 6 versions & 1 rubygems

Version Path
earth-0.12.3 spec/earth/air/airport_spec.rb
earth-0.12.2 spec/earth/air/airport_spec.rb
earth-0.12.1 spec/earth/air/airport_spec.rb
earth-0.12.0 spec/earth/air/airport_spec.rb
earth-0.11.20 spec/earth/air/airport_spec.rb
earth-0.11.19 spec/earth/air/airport_spec.rb