require 'rails_helper'
require 'usda_importer'

RSpec.describe UsdaImporter do

  it 'imports' do
    i = UsdaImporter.new(Rails.root.join('spec', 'test_data'))
    i.import

    expect(UsdaFood.count).to eq 2
    butter = UsdaFood.where(ndbn: '01001').first
    expect(butter).not_to be_nil
    expect(butter.usda_food_weights.count).to eq 4
  end

end