1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #31194 from yahonda/attributes_before_type_cast_on_boolean_with_jruby

No difference between JRuby and CRuby at test_read_attributes_before_…
This commit is contained in:
Yuji Yaginuma 2017-11-23 08:22:06 +09:00 committed by GitHub
commit d6338ad623
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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