aboutsummaryrefslogtreecommitdiffstats
path: root/activeresource/test/cases
diff options
context:
space:
mode:
Diffstat (limited to 'activeresource/test/cases')
-rw-r--r--activeresource/test/cases/base_test.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/activeresource/test/cases/base_test.rb b/activeresource/test/cases/base_test.rb
index 31e0dc0abc..2ed7e1c95f 100644
--- a/activeresource/test/cases/base_test.rb
+++ b/activeresource/test/cases/base_test.rb
@@ -1015,14 +1015,17 @@ class BaseTest < Test::Unit::TestCase
assert xml.include?('<id type="integer">1</id>')
end
-
- def test_to_json_including_root
+ def test_to_json
Person.include_root_in_json = true
Person.format = :json
joe = Person.find(6)
json = joe.encode
Person.format = :xml
- assert_equal json, '{"person":{"person":{"name":"Joe","id":6}}}'
+
+ assert_match %r{^\{"person":\{"person":\{}, json
+ assert_match %r{"id":6}, json
+ assert_match %r{"name":"Joe"}, json
+ assert_match %r{\}\}\}$}, json
end
def test_to_param_quacks_like_active_record