Sha256: e5b5885a169476a4945cecfbd62d1b9daeca70040130977711f2b560486703c7

Contents?: true

Size: 845 Bytes

Versions: 4

Compression:

Stored size: 845 Bytes

Contents

require 'spec_helper'
require 'earth/electricity/electric_market'
require 'earth/electricity/electric_utility' # needed for test verifying link with ElectricUtility

describe ElectricMarket do
  describe 'import', :data_miner => true do
    before :all do
      Earth.init :electricity, :load_data_miner => true, :skip_parent_associations => true
    end
    
    it 'should import data' do
      ElectricMarket.run_data_miner!
    end
  end
  
  describe 'verify imported data', :sanity => true do
    it { ElectricMarket.count.should == 64864 }
    
    it { ElectricMarket.where(:electric_utility_eia_id => nil).count.should == 0 } # some ids aren't found in our electric_utilities table
    
    it 'Properly links 53704 to MG&E' do
      ZipCode.find('53704').electric_utilities.should include(ElectricUtility.find 11479)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
earth-0.12.1 spec/earth/electricity/electric_market_spec.rb
earth-0.12.0 spec/earth/electricity/electric_market_spec.rb
earth-0.11.20 spec/earth/electricity/electric_market_spec.rb
earth-0.11.19 spec/earth/electricity/electric_market_spec.rb