Commit 356b1357 by John Hawthorn

Test for double destroy!

parent 619b49f2
...@@ -339,6 +339,16 @@ class ParanoiaTest < test_framework ...@@ -339,6 +339,16 @@ class ParanoiaTest < test_framework
assert_equal 1, ParanoidModel.unscoped.where(id: model.id).count assert_equal 1, ParanoidModel.unscoped.where(id: model.id).count
end end
# Regression test for #92
def test_destroy_bang_twice
model = ParanoidModel.new
model.save!
model.destroy!
model.destroy!
assert_equal 1, ParanoidModel.unscoped.where(id: model.id).count
end
def test_destroy_return_value_on_success def test_destroy_return_value_on_success
model = ParanoidModel.create model = ParanoidModel.create
return_value = model.destroy return_value = model.destroy
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment