1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #23959 from kamipo/add_test_primary_key_should_be_not_null

Add a test for primary key should be not null
This commit is contained in:
Rafael França 2016-03-01 17:19:48 -03:00
commit a408645223

View file

@ -228,9 +228,10 @@ class PrimaryKeyAnyTypeTest < ActiveRecord::TestCase
def test_any_type_primary_key
assert_equal "code", Barcode.primary_key
column_type = Barcode.type_for_attribute(Barcode.primary_key)
assert_equal :string, column_type.type
assert_equal 42, column_type.limit
column = Barcode.column_for_attribute(Barcode.primary_key)
assert_not column.null unless current_adapter?(:SQLite3Adapter)
assert_equal :string, column.type
assert_equal 42, column.limit
end
test "schema dump primary key includes type and options" do