Skip to content

Instantly share code, notes, and snippets.

@dkam
Created January 22, 2013 04:44
Show Gist options
  • Save dkam/4592098 to your computer and use it in GitHub Desktop.
Save dkam/4592098 to your computer and use it in GitHub Desktop.
test "swapping products for collections" do
c = create(:work)
b1 = create(:book, collection: c)
b2 = create(:book, collection: c)
b3 = create(:book)
result = CollectionMethods.swap_product_for_collection([b1,b2,b3])
assert result.length == 2
assert result.include? c
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment