aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2017-02-09 23:20:13 -0300
committerGitHub <noreply@github.com>2017-02-09 23:20:13 -0300
commit55d66e214825b89442383f90adf575cf8c96568c (patch)
treee57b54ef0314076221077bd29f121bdaf2671b71 /activerecord/test
parentf04a49b033e3da54a52f76289863ec87a3c30438 (diff)
parent61241833ec54fbb030da490eecc5bc69f44dc86e (diff)
downloadrails-55d66e214825b89442383f90adf575cf8c96568c.tar.gz
rails-55d66e214825b89442383f90adf575cf8c96568c.tar.bz2
rails-55d66e214825b89442383f90adf575cf8c96568c.zip
Merge pull request #27957 from kamipo/fix_test_composite_primary_key_out_of_order
Fix `test_composite_primary_key_out_of_order`
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/primary_keys_test.rb10
1 files 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