Permalink
Browse files

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
  • Loading branch information...
1 parent 9e085a9 commit 5d7d0c2fa31d72bc70fdd1b1e34144da9055995d @fxn fxn committed May 3, 2010
Showing with 3 additions and 1 deletion.
  1. +3 −1 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 @@ def as_json(options)
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") ],

0 comments on commit 5d7d0c2

Please sign in to comment.