1
0
Fork 0
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:
Ryuta Kamizono 2016-02-29 21:31:18 +09:00
parent b884ee6fa9
commit a74414c330

View file

@ -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