Sha256: edb0be6eb4e028f36d87119a53923b2d1ecd707ed2e3ce07ce4725d8dc9ead1c

Contents?: true

Size: 843 Bytes

Versions: 2

Compression:

Stored size: 843 Bytes

Contents

require 'spec_helper'
require 'earth/industry/naics_2007'

describe Naics2007 do
  before :all do
    Naics2007.auto_upgrade!
  end
  
  describe "when importing data", :slow => true do
    before do
      require 'earth/industry/naics_2007/data_miner'
    end
    
    it "imports all naics codes" do
      Naics2007.run_data_miner!
      Naics2007.count.should == 2328
    end
  end
  
  describe "code translations" do
    before do
      require 'earth/industry/naics_2002'
      require 'earth/industry/naics_2002_naics_2007_concordance'
    end
    
    it "can be translated to a NAICS 2002 code" do
      {
        '111211' => %w{ 111211 111219 },
        '111310' => %w{ 111310 },
      }.each do |naics_2007, naics_2002|
        Naics2007.find(naics_2007).naics_2002.map(&:code).sort.should == naics_2002
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
earth-0.11.13 spec/earth/industry/naics_2007_spec.rb
earth-0.11.12 spec/earth/industry/naics_2007_spec.rb