aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/pk_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test/cases/pk_test.rb')
-rw-r--r--activerecord/test/cases/pk_test.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/test/cases/pk_test.rb b/activerecord/test/cases/pk_test.rb
index 5bba1d5625..33ad5992de 100644
--- a/activerecord/test/cases/pk_test.rb
+++ b/activerecord/test/cases/pk_test.rb
@@ -23,6 +23,12 @@ class PrimaryKeysTest < ActiveRecord::TestCase
assert_equal keyboard.to_key, [keyboard.id]
end
+ def test_to_key_with_primary_key_after_destroy
+ topic = Topic.find(1)
+ topic.destroy
+ assert_equal topic.to_key, [1]
+ end
+
def test_integer_key
topic = Topic.find(1)
assert_equal(topics(:first).author_name, topic.author_name)