Created
January 22, 2012 00:57
-
-
Save rounders/1654849 to your computer and use it in GitHub Desktop.
testing product creation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
def product_attributes | |
{ | |
:name => "Test Product", | |
:description => "hello world", | |
:sku => "my_sku", | |
:price => 100, | |
:on_hand => 10, | |
:deleted_at => nil, | |
:prototype_id => Spree::Prototype.first.id | |
} | |
end | |
describe Spree::Product do | |
before { Factory(:prototype) } | |
let(:product) { Spree::Product.create(product_attributes)} | |
it "should be a valid product" do | |
product.should be_valid | |
end | |
it "should create the master variant" do | |
product.master.should_not be_nil | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment