Adding specs for deletion/destroy on Digital and DigitalLink

This commit is contained in:
Michael Bianco committed 2012-08-07 11:16:24 -04:00
1 parent 7839238026
commit 156f54e909
2 files changed
+26 -8

No files matched your search

+8 -8
View File
@@ -1,4 +1,4 @@
require File.dirname(__FILE__) + '/../spec_helper'
require 'spec_helper'
describe Spree::Digital do
@@ -12,13 +12,13 @@ describe Spree::Digital do
end
context "#destroy" do
#it "should destroy associated digital_links" do
# digital = FactoryGirl.create(:digital)
# 3.times { digital.digital_links.create! :order => FactoryGirl.create(:order) }
# DigitalLink.count.should == 3
# digital.destroy
# DigitalLink.count.should == 0
#end
it "should destroy associated digital_links" do
digital = FactoryGirl.create(:digital)
3.times { digital.digital_links.create!({ :line_item => FactoryGirl.create(:line_item) }, :without_protection => true) }
Spree::DigitalLink.count.should == 3
digital.destroy
Spree::DigitalLink.count.should == 0
end
end
end