mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Fix test_composite_primary_key_out_of_order
`test_composite_primary_key_out_of_order` should use `barcodes_reverse` table.
This commit is contained in:
parent
e04de27b2f
commit
283250fc30
1 changed files with 8 additions and 2 deletions
|
@ -314,7 +314,7 @@ class CompositePrimaryKeyTest < ActiveRecord::TestCase
|
||||||
|
|
||||||
def test_composite_primary_key_out_of_order
|
def test_composite_primary_key_out_of_order
|
||||||
skip if current_adapter?(:SQLite3Adapter)
|
skip if current_adapter?(:SQLite3Adapter)
|
||||||
assert_equal ["region", "code"], @connection.primary_keys("barcodes")
|
assert_equal ["code", "region"], @connection.primary_keys("barcodes_reverse")
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_primary_key_issues_warning
|
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)
|
assert_match(/WARNING: Active Record does not support composite primary key\./, warning)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_collectly_dump_composite_primary_key
|
def test_dumping_composite_primary_key
|
||||||
schema = dump_table_schema "barcodes"
|
schema = dump_table_schema "barcodes"
|
||||||
assert_match %r{create_table "barcodes", primary_key: \["region", "code"\]}, schema
|
assert_match %r{create_table "barcodes", primary_key: \["region", "code"\]}, schema
|
||||||
end
|
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
|
end
|
||||||
|
|
||||||
class PrimaryKeyIntegerNilDefaultTest < ActiveRecord::TestCase
|
class PrimaryKeyIntegerNilDefaultTest < ActiveRecord::TestCase
|
||||||
|
|
Loading…
Reference in a new issue