mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Add a test for primary key should be not null
This commit is contained in:
parent
b884ee6fa9
commit
a74414c330
1 changed files with 4 additions and 3 deletions
|
@ -228,9 +228,10 @@ class PrimaryKeyAnyTypeTest < ActiveRecord::TestCase
|
||||||
def test_any_type_primary_key
|
def test_any_type_primary_key
|
||||||
assert_equal "code", Barcode.primary_key
|
assert_equal "code", Barcode.primary_key
|
||||||
|
|
||||||
column_type = Barcode.type_for_attribute(Barcode.primary_key)
|
column = Barcode.column_for_attribute(Barcode.primary_key)
|
||||||
assert_equal :string, column_type.type
|
assert_not column.null unless current_adapter?(:SQLite3Adapter)
|
||||||
assert_equal 42, column_type.limit
|
assert_equal :string, column.type
|
||||||
|
assert_equal 42, column.limit
|
||||||
end
|
end
|
||||||
|
|
||||||
test "schema dump primary key includes type and options" do
|
test "schema dump primary key includes type and options" do
|
||||||
|
|
Loading…
Reference in a new issue