Skip to content

Instantly share code, notes, and snippets.

@rounders
Created January 22, 2012 00:57
Show Gist options
  • Save rounders/1654849 to your computer and use it in GitHub Desktop.
Save rounders/1654849 to your computer and use it in GitHub Desktop.
testing product creation
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