aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/persistence_test.rb
diff options
context:
space:
mode:
authorMarc-Andre Lafortune <github@marc-andre.ca>2012-06-05 02:35:05 -0400
committerMarc-Andre Lafortune <github@marc-andre.ca>2012-06-06 13:27:51 -0400
commit4faaa811614b408b32422692ce36024442d02ffb (patch)
tree340a1cda35d66d2db76d36ca66fa6a9701b9734e /activerecord/test/cases/persistence_test.rb
parent2186540f9160b47e075b9926d12d3a6843e95d31 (diff)
downloadrails-4faaa811614b408b32422692ce36024442d02ffb.tar.gz
rails-4faaa811614b408b32422692ce36024442d02ffb.tar.bz2
rails-4faaa811614b408b32422692ce36024442d02ffb.zip
+ ActiveRecord::Base#destroy!
Diffstat (limited to 'activerecord/test/cases/persistence_test.rb')
-rw-r--r--activerecord/test/cases/persistence_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/activerecord/test/cases/persistence_test.rb b/activerecord/test/cases/persistence_test.rb
index 0933a4ff3d..fecdf2b705 100644
--- a/activerecord/test/cases/persistence_test.rb
+++ b/activerecord/test/cases/persistence_test.rb
@@ -305,6 +305,13 @@ class PersistencesTest < ActiveRecord::TestCase
assert_raise(ActiveRecord::RecordNotFound) { Topic.find(topic.id) }
end
+ def test_destroy!
+ topic = Topic.find(1)
+ assert_equal topic, topic.destroy!, 'topic.destroy! did not return self'
+ assert topic.frozen?, 'topic not frozen after destroy!'
+ assert_raise(ActiveRecord::RecordNotFound) { Topic.find(topic.id) }
+ end
+
def test_record_not_found_exception
assert_raise(ActiveRecord::RecordNotFound) { Topic.find(99999) }
end