Sha256: 369ba5fd41cb59ce2b93277c5d966d125386d5eb688d2d476b4a0f9e6b96837a

Contents?: true

Size: 704 Bytes

Versions: 23

Compression:

Stored size: 704 Bytes

Contents

require 'spec_helper'

describe UsdaNutrientDatabase::Import::FoodGroups do
  let(:importer) { described_class.new('spec/support/sr25') }

  describe '#import' do
    before { importer.import }

    it 'should import all food groups' do
      expect(UsdaNutrientDatabase::FoodGroup.count).to eql(2)
    end

    it 'should import food group data correctly' do
      [
        { code: '0100', description: 'Dairy and Egg Products' },
        { code: '0200', description: 'Spices and Herbs' }
      ].each do |product|
        expect(
          UsdaNutrientDatabase::FoodGroup.
          where(code: product[:code], description: product[:description]).count
        ).to eql(1)
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
usda-nutrient-database-2.1.2 spec/lib/usda_nutrient_database/import/food_groups_spec.rb
usda-nutrient-database-1.5.0 spec/lib/usda_nutrient_database/import/food_groups_spec.rb
usda-nutrient-database-1.4.1 spec/lib/usda_nutrient_database/import/food_groups_spec.rb
usda-nutrient-database-2.1.1 spec/lib/usda_nutrient_database/import/food_groups_spec.rb
usda-nutrient-database-2.1.0 spec/lib/usda_nutrient_database/import/food_groups_spec.rb
usda-nutrient-database-2.0.0 spec/lib/usda_nutrient_database/import/food_groups_spec.rb
usda-nutrient-database-1.4.0 spec/lib/usda_nutrient_database/import/food_groups_spec.rb
usda-nutrient-database-1.3.0 spec/lib/usda_nutrient_database/import/food_groups_spec.rb
usda-nutrient-database-1.2.0 spec/lib/usda_nutrient_database/import/food_groups_spec.rb
usda-nutrient-database-1.1.0 spec/lib/usda_nutrient_database/import/food_groups_spec.rb
usda-nutrient-database-1.0.1 spec/lib/usda_nutrient_database/import/food_groups_spec.rb
usda-nutrient-database-1.0.0 spec/lib/usda_nutrient_database/import/food_groups_spec.rb
usda-nutrient-database-0.8.1 spec/lib/usda_nutrient_database/import/food_groups_spec.rb
usda-nutrient-database-0.8.0 spec/lib/usda_nutrient_database/import/food_groups_spec.rb
usda-nutrient-database-0.7.0 spec/lib/usda_nutrient_database/import/food_groups_spec.rb
usda-nutrient-database-0.6.0 spec/lib/usda_nutrient_database/import/food_groups_spec.rb
usda-nutrient-database-0.5.0 spec/lib/usda_nutrient_database/import/food_groups_spec.rb
usda-nutrient-database-0.4.0 spec/lib/usda_nutrient_database/import/food_groups_spec.rb
usda-nutrient-database-0.3.0 spec/lib/usda_nutrient_database/import/food_groups_spec.rb
usda-nutrient-database-0.2.0 spec/lib/usda_nutrient_database/import/food_groups_spec.rb