diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2017-08-14 16:00:25 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2017-08-14 17:27:54 +0900 |
commit | a516dfd4b4adf904d41983044e2ccad0fbaf7a28 (patch) | |
tree | 7f55671cf1ebcdcae80f73b5c238980e040ea468 /activerecord/test/cases | |
parent | 691af789000446cedbe9faf532a991a87c7e254c (diff) | |
download | rails-a516dfd4b4adf904d41983044e2ccad0fbaf7a28.tar.gz rails-a516dfd4b4adf904d41983044e2ccad0fbaf7a28.tar.bz2 rails-a516dfd4b4adf904d41983044e2ccad0fbaf7a28.zip |
Fix CI failure due to reference type mismatch
`Firm.id` is a bigint if mysql2 adapter is used, but `firm_id` is an
integer. It will cause an out of range error.
https://travis-ci.org/rails/rails/jobs/264112814#L776
https://travis-ci.org/rails/rails/jobs/264112835#L919
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/base_test.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/activerecord/test/cases/base_test.rb b/activerecord/test/cases/base_test.rb index 1d33564989..1a1d4ce039 100644 --- a/activerecord/test/cases/base_test.rb +++ b/activerecord/test/cases/base_test.rb @@ -885,10 +885,17 @@ class BasicsTest < ActiveRecord::TestCase def test_bignum company = Company.find(1) - company.rating = 2147483647 + company.rating = 2147483648 company.save company = Company.find(1) - assert_equal 2147483647, company.rating + assert_equal 2147483648, company.rating + end + + unless current_adapter?(:SQLite3Adapter) + def test_bignum_pk + company = Company.create!(id: 2147483648, name: "foo") + assert_equal company, Company.find(company.id) + end end # TODO: extend defaults tests to other databases! |