From 6ccbc638494e41e1f9320a00b51ddfc16a387191 Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Wed, 30 Mar 2016 05:54:15 +0900 Subject: Add a test case for create a record with primary key as zero --- activerecord/test/cases/adapter_test.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'activerecord/test') 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 } -- cgit v1.2.3