diff options
author | Eileen M. Uchitelle <eileencodes@users.noreply.github.com> | 2017-02-03 08:37:07 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-03 08:37:07 -0500 |
commit | 26a137b946d2e1e54993eebc2b94cd278cd69c21 (patch) | |
tree | 47c4564f2e3f91abb09a599388e3e6b53e55a2f1 /activerecord | |
parent | 7ca367238d9db240095241edb8a801eaf23200d7 (diff) | |
parent | 15bb36f71f7d02bd93760ab9faa458ab58f58c12 (diff) | |
download | rails-26a137b946d2e1e54993eebc2b94cd278cd69c21.tar.gz rails-26a137b946d2e1e54993eebc2b94cd278cd69c21.tar.bz2 rails-26a137b946d2e1e54993eebc2b94cd278cd69c21.zip |
Merge pull request #27881 from koic/fix_test_type_map_lookup_using_oracle
Fix a test of AR::Type::TypeMap#lookup when using Oracle
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/test/cases/connection_adapters/type_lookup_test.rb | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/activerecord/test/cases/connection_adapters/type_lookup_test.rb b/activerecord/test/cases/connection_adapters/type_lookup_test.rb index e2e5445a4e..a348c2d783 100644 --- a/activerecord/test/cases/connection_adapters/type_lookup_test.rb +++ b/activerecord/test/cases/connection_adapters/type_lookup_test.rb @@ -89,12 +89,20 @@ unless current_adapter?(:PostgreSQLAdapter) # PostgreSQL does not use type strin 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 |