mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #23373 from kamipo/remove_duplicated_composite_primary_key_tests
Remove duplicated composite primary key tests
This commit is contained in:
commit
f9c57f1b4b
3 changed files with 1 additions and 17 deletions
|
@ -53,14 +53,6 @@ module ActiveRecord
|
|||
end
|
||||
end
|
||||
|
||||
def test_composite_primary_key
|
||||
with_example_table 'id serial, number serial, PRIMARY KEY (id, number)' do
|
||||
silence_warnings do
|
||||
assert_nil @connection.primary_key('ex')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def test_primary_key_raises_error_if_table_not_found
|
||||
assert_raises(ActiveRecord::StatementInvalid) do
|
||||
@connection.primary_key('unobtainium')
|
||||
|
|
|
@ -400,14 +400,6 @@ module ActiveRecord
|
|||
end
|
||||
end
|
||||
|
||||
def test_composite_primary_key
|
||||
with_example_table 'id integer, number integer, foo integer, PRIMARY KEY (id, number)' do
|
||||
silence_warnings do
|
||||
assert_nil @conn.primary_key('ex')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def test_supports_extensions
|
||||
assert_not @conn.supports_extensions?, 'does not support extensions'
|
||||
end
|
||||
|
|
|
@ -262,7 +262,7 @@ class CompositePrimaryKeyTest < ActiveRecord::TestCase
|
|||
|
||||
def test_primary_key_issues_warning
|
||||
warning = capture(:stderr) do
|
||||
@connection.primary_key("barcodes")
|
||||
assert_nil @connection.primary_key("barcodes")
|
||||
end
|
||||
assert_match(/WARNING: Rails does not support composite primary key\./, warning)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue