aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2016-03-30 05:54:15 +0900
committerRyuta Kamizono <kamipo@gmail.com>2016-03-30 06:07:57 +0900
commit6ccbc638494e41e1f9320a00b51ddfc16a387191 (patch)
treeb1e7dfe0e8b950d4a60af0e04e412ab61ba88c3a /activerecord/test
parentcd736dbfa4c81166797a55d4877aac92e45327f8 (diff)
downloadrails-6ccbc638494e41e1f9320a00b51ddfc16a387191.tar.gz
rails-6ccbc638494e41e1f9320a00b51ddfc16a387191.tar.bz2
rails-6ccbc638494e41e1f9320a00b51ddfc16a387191.zip
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.rb6
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 }