Create note on discontinued development
[merb_mart.git] / spec / models / upload / image / product_image_spec.rb
blob81389d53263d1f95a584ca9c9befe880fc119d19
1 require File.join( File.dirname(__FILE__), "..", "..", "..", "spec_helper" )
3 describe ProductImage do
4   before(:each) do
5     DataMapper.auto_migrate!
6   end
8   describe "associatons" do
9     it "should belong to a product" do
10       product = Product.gen
11       product_image = ProductImage.create(ProductImage.gen_attrs.merge(:product => product))
12       product_image.product.should == product
13       product_image.should be_valid
15       product_image = ProductImage.create(ProductImage.gen_attrs.except(:product))
16       product_image.product.should be_nil
17       product_image.should_not be_valid
18       product_image.errors.should include(:product)
19     end
20   end
21 end