diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2010-12-03 13:52:07 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2010-12-03 13:52:07 +0000 |
commit | 735a83c596156e32f8cc686207eecddc029d7629 (patch) | |
tree | 3247605f58fde81458b096a4fa68b2837952031a /test/unit | |
parent | eaf6bb1e9bc1ac3b5309f51ea9f76e6f95ba5813 (diff) | |
download | redmine-735a83c596156e32f8cc686207eecddc029d7629.tar.gz redmine-735a83c596156e32f8cc686207eecddc029d7629.zip |
Converts IssuesController to use the new API template system and makes xml/json responses consistent (#6136).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4458 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/lib/redmine/views/builders/json_test.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/unit/lib/redmine/views/builders/json_test.rb b/test/unit/lib/redmine/views/builders/json_test.rb index 52e6b9ca6..195fba020 100644 --- a/test/unit/lib/redmine/views/builders/json_test.rb +++ b/test/unit/lib/redmine/views/builders/json_test.rb @@ -28,6 +28,15 @@ class Redmine::Views::Builders::JsonTest < HelperTestCase end end + def test_hash_hash + assert_json_output({'person' => {'name' => 'Ryan', 'birth' => {'city' => 'London', 'country' => 'UK'}}}) do |b| + b.person do + b.name 'Ryan' + b.birth :city => 'London', :country => 'UK' + end + end + end + def test_array assert_json_output({'books' => [{'title' => 'Book 1', 'author' => 'B. Smith'}, {'title' => 'Book 2', 'author' => 'G. Cooper'}]}) do |b| b.array :books do |b| |