Created
October 18, 2012 12:43
-
-
Save anonymous/3911555 to your computer and use it in GitHub Desktop.
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' | |
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