spec/model_spec.rb in blendris-0.0.4 vs spec/model_spec.rb in blendris-0.5
- old
+ new
@@ -33,9 +33,14 @@
@fruit.foods.should be_include(@apple)
@fruit.foods.should be_include(@lemon)
@fruit.foods.should be_include(Food.new("food:lemon"))
@fruit.foods.should_not be_include(@steak)
+
+ @fruit.foods = @onion
+
+ @fruit.foods.count.should == 1
+ @fruit.foods.first.should == @onion
end
it "should not allow you to instantiate with a key that doesnt match its class" do
lambda { Category.new("balogna") }.should raise_error(TypeError)
lambda { Category.new(@onion.key) }.should raise_error(TypeError)