From a74414c3309bcf24781aa88e8317f5df1fa43405 Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Mon, 29 Feb 2016 21:31:18 +0900 Subject: Add a test for primary key should be not null --- activerecord/test/cases/primary_keys_test.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'activerecord/test/cases') diff --git a/activerecord/test/cases/primary_keys_test.rb b/activerecord/test/cases/primary_keys_test.rb index e27a747730..6aaee8de7c 100644 --- a/activerecord/test/cases/primary_keys_test.rb +++ b/activerecord/test/cases/primary_keys_test.rb @@ -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 -- cgit v1.2.3