aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/json/encoding_test.rb
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2010-05-03 22:10:36 +0200
committerXavier Noria <fxn@hashref.com>2010-05-03 22:11:33 +0200
commit5d7d0c2fa31d72bc70fdd1b1e34144da9055995d (patch)
treedfbeff58849594cf4fd62fc10116b5b7e5de107b /activesupport/test/json/encoding_test.rb
parent9e085a9f3365e316e2026addedef30f08ead46f2 (diff)
downloadrails-5d7d0c2fa31d72bc70fdd1b1e34144da9055995d.tar.gz
rails-5d7d0c2fa31d72bc70fdd1b1e34144da9055995d.tar.bz2
rails-5d7d0c2fa31d72bc70fdd1b1e34144da9055995d.zip
BigDecimal#as_json does not really specify the F format, it delegates that to whatever BigDecimal#to_s default format is, do the same in its test
Diffstat (limited to 'activesupport/test/json/encoding_test.rb')
-rw-r--r--activesupport/test/json/encoding_test.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/activesupport/test/json/encoding_test.rb b/activesupport/test/json/encoding_test.rb
index ac7ca96c4d..a8ecf4e4cf 100644
--- a/activesupport/test/json/encoding_test.rb
+++ b/activesupport/test/json/encoding_test.rb
@@ -1,5 +1,7 @@
# encoding: utf-8
require 'abstract_unit'
+require 'bigdecimal'
+require 'active_support/core_ext/big_decimal/conversions'
require 'active_support/json'
class TestJSONEncoding < Test::Unit::TestCase
@@ -26,7 +28,7 @@ class TestJSONEncoding < Test::Unit::TestCase
NilTests = [[ nil, %(null) ]]
NumericTests = [[ 1, %(1) ],
[ 2.5, %(2.5) ],
- [ BigDecimal('2.5'), %("#{BigDecimal('2.5').to_s('F')}") ]]
+ [ BigDecimal('2.5'), %("#{BigDecimal('2.5').to_s}") ]]
StringTests = [[ 'this is the <string>', %("this is the \\u003Cstring\\u003E")],
[ 'a "string" with quotes & an ampersand', %("a \\"string\\" with quotes \\u0026 an ampersand") ],