diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2016-02-29 21:31:18 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2016-02-29 21:31:18 +0900 |
commit | a74414c3309bcf24781aa88e8317f5df1fa43405 (patch) | |
tree | 5ba4e34b4f6a27827d2df283606b6a5112b08b1b /activerecord | |
parent | b884ee6fa90a0fa96bb40322393815ec78ff805c (diff) | |
download | rails-a74414c3309bcf24781aa88e8317f5df1fa43405.tar.gz rails-a74414c3309bcf24781aa88e8317f5df1fa43405.tar.bz2 rails-a74414c3309bcf24781aa88e8317f5df1fa43405.zip |
Add a test for primary key should be not null
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/test/cases/primary_keys_test.rb | 7 |
1 files changed, 4 insertions, 3 deletions
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 |