diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2016-03-29 23:55:06 -0300 |
---|---|---|
committer | Rafael França <rafaelmfranca@gmail.com> | 2016-03-29 23:55:06 -0300 |
commit | 5870bc8698c3102a05c4543fbc955530e15f936c (patch) | |
tree | 1726de078ab21118e2bb8f6a9dd077c12a890953 /activerecord/test | |
parent | 532b163e5e2a7295150f0fa9784dd9da6fe96136 (diff) | |
parent | 6ccbc638494e41e1f9320a00b51ddfc16a387191 (diff) | |
download | rails-5870bc8698c3102a05c4543fbc955530e15f936c.tar.gz rails-5870bc8698c3102a05c4543fbc955530e15f936c.tar.bz2 rails-5870bc8698c3102a05c4543fbc955530e15f936c.zip |
Merge pull request #24362 from kamipo/add_test_create_record_with_pk_as_zero
Add a test case for create a record with primary key as zero
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/adapter_test.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/test/cases/adapter_test.rb b/activerecord/test/cases/adapter_test.rb index a9f1993842..4f389e9249 100644 --- a/activerecord/test/cases/adapter_test.rb +++ b/activerecord/test/cases/adapter_test.rb @@ -23,6 +23,12 @@ module ActiveRecord end end + def test_create_record_with_pk_as_zero + Book.create(id: 0) + assert_equal 0, Book.find(0).id + assert_nothing_raised { Book.destroy(0) } + end + def test_tables tables = nil ActiveSupport::Deprecation.silence { tables = @connection.tables } |