From 89845ff86654274f183645c451b07233c18f67f7 Mon Sep 17 00:00:00 2001 From: Yves Senn Date: Fri, 6 Jun 2014 15:38:14 +0200 Subject: test refactor, don't hardcode `primary_key_prefix_type` default. /cc @zuhao --- activerecord/test/cases/primary_keys_test.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'activerecord/test') diff --git a/activerecord/test/cases/primary_keys_test.rb b/activerecord/test/cases/primary_keys_test.rb index c719918fd7..f43483d291 100644 --- a/activerecord/test/cases/primary_keys_test.rb +++ b/activerecord/test/cases/primary_keys_test.rb @@ -92,6 +92,7 @@ class PrimaryKeysTest < ActiveRecord::TestCase end def test_primary_key_prefix + old_primary_key_prefix_type = ActiveRecord::Base.primary_key_prefix_type ActiveRecord::Base.primary_key_prefix_type = :table_name Topic.reset_primary_key assert_equal "topicid", Topic.primary_key @@ -103,6 +104,8 @@ class PrimaryKeysTest < ActiveRecord::TestCase ActiveRecord::Base.primary_key_prefix_type = nil Topic.reset_primary_key assert_equal "id", Topic.primary_key + ensure + ActiveRecord::Base.primary_key_prefix_type = old_primary_key_prefix_type end def test_delete_should_quote_pkey -- cgit v1.2.3