Sha256: 2cf92c8319114cbbc6797ad609a12779dd618ba69e955e2cca10d98d94a9c661
Contents?: true
Size: 993 Bytes
Versions: 56
Compression:
Stored size: 993 Bytes
Contents
require File.dirname(__FILE__) + '/../abstract_unit' class TestJSONDecoding < Test::Unit::TestCase TESTS = { %({"returnTo":{"/categories":"/"}}) => {"returnTo" => {"/categories" => "/"}}, %({returnTo:{"/categories":"/"}}) => {"returnTo" => {"/categories" => "/"}}, %({"return\\"To\\":":{"/categories":"/"}}) => {"return\"To\":" => {"/categories" => "/"}}, %({"returnTo":{"/categories":1}}) => {"returnTo" => {"/categories" => 1}}, %({"returnTo":[1,"a"]}) => {"returnTo" => [1, "a"]}, %({"returnTo":[1,"\\"a\\",", "b"]}) => {"returnTo" => [1, "\"a\",", "b"]}, %([]) => [], %({}) => {}, %(1) => 1, %("") => "", %("\\"") => "\"", %(null) => nil, %(true) => true, %(false) => false } def test_json_decoding TESTS.each do |json, expected| assert_nothing_raised do assert_equal expected, ActiveSupport::JSON.decode(json) end end end end
Version data entries
56 entries across 56 versions & 1 rubygems