Sha256: 6b90bbed2e8633c20b086f5a14189569e0ee1281eaa053105d21f11290ed7858

Contents?: true

Size: 563 Bytes

Versions: 3

Compression:

Stored size: 563 Bytes

Contents

require 'spec_helper'

describe UsdaNutrientDatabase::Importer do
  let(:importer) { UsdaNutrientDatabase::Importer.new }

  describe '#import' do
    before do
      stub_request(:get, /.*/).
        to_return(body: File.read('spec/support/sr25.zip'))
      importer.import
    end

    it { expect(UsdaNutrientDatabase::FoodGroup.count).to eql(25) }
    it { expect(UsdaNutrientDatabase::Food.count).to eql(16) }
    it { expect(UsdaNutrientDatabase::Nutrient.count).to eql(15) }
    it { expect(UsdaNutrientDatabase::FoodsNutrient.count).to eql(12) }
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
usda-nutrient-database-0.1.2 spec/lib/usda_nutrient_database/importer_spec.rb
usda-nutrient-database-0.1.1 spec/lib/usda_nutrient_database/importer_spec.rb
usda-nutrient-database-0.1.0 spec/lib/usda_nutrient_database/importer_spec.rb