spec/mongoid/paranoia_spec.rb in mongoid_paranoia-0.4.1 vs spec/mongoid/paranoia_spec.rb in mongoid_paranoia-0.5.0
- old
+ new
@@ -529,14 +529,14 @@
before do
post.delete!
end
- it "cascades the dependent option" do
+ it "does not cascade the dependent option" do
expect {
author.reload
- }.to raise_error(Mongoid::Errors::DocumentNotFound)
+ }.to_not raise_error(Mongoid::Errors::DocumentNotFound)
end
end
end
describe "#delete" do
@@ -611,14 +611,14 @@
before do
post.delete
end
- it "cascades the dependent option" do
+ it "does not cascade the dependent option" do
expect {
author.reload
- }.to raise_error(Mongoid::Errors::DocumentNotFound)
+ }.to_not raise_error(Mongoid::Errors::DocumentNotFound)
end
end
context "when the document has a dependent: :restrict relation" do
@@ -635,11 +635,11 @@
post.delete
rescue Mongoid::Errors::DeleteRestriction
end
end
- it "does not destroy the document" do
- expect(post).not_to be_destroyed
+ it "ignores restrict and destroys the document" do
+ expect(post).to be_destroyed
end
end
end
describe "#remove" do