@@ -56,7 +56,11 module Redmine | |||||
56 | if @struct.last.is_a?(Array) |
|
56 | if @struct.last.is_a?(Array) | |
57 | @struct.last << ret |
|
57 | @struct.last << ret | |
58 | else |
|
58 | else | |
59 | @struct.last[sym] = ret |
|
59 | if @struct.last.has_key?(sym) && @struct.last[sym].is_a?(Hash) | |
|
60 | @struct.last[sym].merge! ret | |||
|
61 | else | |||
|
62 | @struct.last[sym] = ret | |||
|
63 | end | |||
60 | end |
|
64 | end | |
61 | end |
|
65 | end | |
62 | end |
|
66 | end |
@@ -35,6 +35,13 class Redmine::Views::Builders::JsonTest < HelperTestCase | |||||
35 | b.birth :city => 'London', :country => 'UK' |
|
35 | b.birth :city => 'London', :country => 'UK' | |
36 | end |
|
36 | end | |
37 | end |
|
37 | end | |
|
38 | ||||
|
39 | assert_json_output({'person' => {'id' => 1, 'name' => 'Ryan', 'birth' => {'city' => 'London', 'country' => 'UK'}}}) do |b| | |||
|
40 | b.person :id => 1 do | |||
|
41 | b.name 'Ryan' | |||
|
42 | b.birth :city => 'London', :country => 'UK' | |||
|
43 | end | |||
|
44 | end | |||
38 | end |
|
45 | end | |
39 |
|
46 | |||
40 | def test_array |
|
47 | def test_array |
General Comments 0
You need to be logged in to leave comments.
Login now