aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/attribute_methods_test.rb
diff options
context:
space:
mode:
authorYasuo Honda <yasuo.honda@gmail.com>2017-11-21 17:43:42 +0000
committerYasuo Honda <yasuo.honda@gmail.com>2017-11-21 18:18:00 +0000
commit2cc5ccedb1cabd818ece3d6736b412de086a16c1 (patch)
tree8f0c548b788da24087aaf2dda3d46abfa03d9332 /activerecord/test/cases/attribute_methods_test.rb
parent3e304e8177bc1fd81d9d8db15eaf252cf386e22f (diff)
downloadrails-2cc5ccedb1cabd818ece3d6736b412de086a16c1.tar.gz
rails-2cc5ccedb1cabd818ece3d6736b412de086a16c1.tar.bz2
rails-2cc5ccedb1cabd818ece3d6736b412de086a16c1.zip
No difference between JRuby and CRuby at test_read_attributes_before_type_cast_on_a_boolean
https://github.com/jruby/activerecord-jdbc-adapter ActiveRecord JDBC Adapter is actively developed and it supports Rails 5.1 now. This pull request addresses one of the failure when running ActiveRecord unit tests with ActiveRecord JDBC Adapter. As of right now, ActiveRecord JDBC Adapter supports Rails 5.1, not master branch then this test only can run on `5-1-stable` branch. But I have opened this pull request to `master` branch since this type cast should be going to work in the future versions of ActiveRecord JDBC Adapter . ```ruby $ ARCONN=jdbcmysql bin/test test/cases/attribute_methods_test.rb:203 Using jdbcmysql Run options: --seed 8874 F Finished in 0.709120s, 1.4102 runs/s, 1.4102 assertions/s. 1) Failure: AttributeMethodsTest#test_read_attributes_before_type_cast_on_a_boolean [/home/yahonda/git/rails/activerecord/test/cases/attribute_methods_test.rb:203]: Expected: "0" Actual: 0 1 runs, 1 assertions, 1 failures, 0 errors, 0 skips $ ```
Diffstat (limited to 'activerecord/test/cases/attribute_methods_test.rb')
-rw-r--r--activerecord/test/cases/attribute_methods_test.rb7
1 files changed, 1 insertions, 6 deletions
diff --git a/activerecord/test/cases/attribute_methods_test.rb b/activerecord/test/cases/attribute_methods_test.rb
index 2f42684212..c48f7d3518 100644
--- a/activerecord/test/cases/attribute_methods_test.rb
+++ b/activerecord/test/cases/attribute_methods_test.rb
@@ -200,12 +200,7 @@ class AttributeMethodsTest < ActiveRecord::TestCase
if current_adapter?(:Mysql2Adapter)
test "read attributes_before_type_cast on a boolean" do
bool = Boolean.create!("value" => false)
- if RUBY_PLATFORM.include?("java")
- # JRuby will return the value before typecast as string.
- assert_equal "0", bool.reload.attributes_before_type_cast["value"]
- else
- assert_equal 0, bool.reload.attributes_before_type_cast["value"]
- end
+ assert_equal 0, bool.reload.attributes_before_type_cast["value"]
end
end