Sha256: b99e471d470723f846a4d7bd954716602d3b5ea6800a8f0affebae21f9ab561c

Contents?: true

Size: 633 Bytes

Versions: 7

Compression:

Stored size: 633 Bytes

Contents

require 'spec_helper'
require "#{Earth::FACTORY_DIR}/food_group"

describe FoodGroup do
  describe '.names' do
    it "returns a list of food group names" do
      FoodGroup.delete_all
      FactoryGirl.create :food_group, :meat
      FactoryGirl.create :food_group, :veg
      FoodGroup.names.should == ['meat', 'veg']
    end
  end
  
  describe '.[](name)' do
    it "finds by name" do
      meat = FactoryGirl.create :food_group, :meat
      FoodGroup['meat'].should == meat
    end
  end
  
  describe 'Sanity check', :sanity => true do
    it { FoodGroup.count.should == 10 }
    
    # FIXME TODO more sanity checks
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
earth-1.2.1 spec/earth/diet/food_group_spec.rb
earth-1.1.2 spec/earth/diet/food_group_spec.rb
earth-1.1.1 spec/earth/diet/food_group_spec.rb
earth-1.1.0 spec/earth/diet/food_group_spec.rb
earth-1.0.3 spec/earth/diet/food_group_spec.rb
earth-1.0.2 spec/earth/diet/food_group_spec.rb
earth-1.0.1 spec/earth/diet/food_group_spec.rb