Skip to content

Instantly share code, notes, and snippets.

Created October 18, 2012 12:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/3911555 to your computer and use it in GitHub Desktop.
Save anonymous/3911555 to your computer and use it in GitHub Desktop.
require 'spec_helper'
describe Organization do
before do
@organization = Organization.new(name: "Hogwarts", location_id: 0)
end
subject { @organization }
describe "publishes_product" do
let(:product) { FactoryGirl.create(:product) }
before do
@organization.save
@sub_org = Organization.create!(name: "Sub Org", location_id: 0, parent_id: @organization.id)
product.save
@organization.publish_product!(product)
end
subject { @sub_org }
it { should have_product(product) }
its(:products) { should include(product) }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment