Permalink
Browse files

Merge pull request #27881 from koic/fix_test_type_map_lookup_using_or…

…acle

Fix a test of AR::Type::TypeMap#lookup when using Oracle
  • Loading branch information...
eileencodes committed Feb 3, 2017
1 parent 4277047 commit 0eaecdb7b8320ee2227544263174d3dd89e1d8cf
Showing with 14 additions and 6 deletions.
  1. +14 −6 activerecord/test/cases/connection_adapters/type_lookup_test.rb
@@ -89,12 +89,20 @@ def test_bigint_limit
end
def test_decimal_without_scale
- types = %w{decimal(2) decimal(2,0) numeric(2) numeric(2,0) number(2) number(2,0)}
- types.each do |type|
- cast_type = @connection.type_map.lookup(type)
-
- assert_equal :decimal, cast_type.type
- assert_equal 2, cast_type.cast(2.1)
+ if current_adapter?(:OracleAdapter)
+ {
+ decimal: %w{decimal(2) decimal(2,0) numeric(2) numeric(2,0)},
+ integer: %w{number(2) number(2,0)}
+ }
+ else
+ { decimal: %w{decimal(2) decimal(2,0) numeric(2) numeric(2,0) number(2) number(2,0)} }
+ end.each do |expected_type, types|
+ types.each do |type|
+ cast_type = @connection.type_map.lookup(type)
+
+ assert_equal expected_type, cast_type.type
+ assert_equal 2, cast_type.cast(2.1)
+ end
end
end

0 comments on commit 0eaecdb

Please sign in to comment.