Sha256: c9c7987d2ee5e2b83c583a1fab9fbde00b486e31a295e667f0bf2668b658e535

Contents?: true

Size: 836 Bytes

Versions: 3

Compression:

Stored size: 836 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 'links 53704 to MG&E' do
      ZipCode.find('53704').electric_utilities.should include(ElectricUtility.find 11479)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
earth-0.12.4 spec/earth/electricity/electric_market_spec.rb
earth-0.12.3 spec/earth/electricity/electric_market_spec.rb
earth-0.12.2 spec/earth/electricity/electric_market_spec.rb