From 283250fc3050e55661b709f2e93fb20c0aff99b2 Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Fri, 10 Feb 2017 10:36:36 +0900 Subject: [PATCH] Fix `test_composite_primary_key_out_of_order` `test_composite_primary_key_out_of_order` should use `barcodes_reverse` table. --- activerecord/test/cases/primary_keys_test.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/activerecord/test/cases/primary_keys_test.rb b/activerecord/test/cases/primary_keys_test.rb index 0c6799c015..c147b01daf 100644 --- a/activerecord/test/cases/primary_keys_test.rb +++ b/activerecord/test/cases/primary_keys_test.rb @@ -314,7 +314,7 @@ class CompositePrimaryKeyTest < ActiveRecord::TestCase def test_composite_primary_key_out_of_order skip if current_adapter?(:SQLite3Adapter) - assert_equal ["region", "code"], @connection.primary_keys("barcodes") + assert_equal ["code", "region"], @connection.primary_keys("barcodes_reverse") end def test_primary_key_issues_warning @@ -329,10 +329,16 @@ class CompositePrimaryKeyTest < ActiveRecord::TestCase assert_match(/WARNING: Active Record does not support composite primary key\./, warning) end - def test_collectly_dump_composite_primary_key + def test_dumping_composite_primary_key schema = dump_table_schema "barcodes" assert_match %r{create_table "barcodes", primary_key: \["region", "code"\]}, schema end + + def test_dumping_composite_primary_key_out_of_order + skip if current_adapter?(:SQLite3Adapter) + schema = dump_table_schema "barcodes_reverse" + assert_match %r{create_table "barcodes_reverse", primary_key: \["code", "region"\]}, schema + end end class PrimaryKeyIntegerNilDefaultTest < ActiveRecord::TestCase