@@ -56,7 +56,11 module Redmine | |||
|
56 | 56 | if @struct.last.is_a?(Array) |
|
57 | 57 | @struct.last << ret |
|
58 | 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 | 64 | end |
|
61 | 65 | end |
|
62 | 66 | end |
@@ -35,6 +35,13 class Redmine::Views::Builders::JsonTest < HelperTestCase | |||
|
35 | 35 | b.birth :city => 'London', :country => 'UK' |
|
36 | 36 | end |
|
37 | 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 | 45 | end |
|
39 | 46 | |
|
40 | 47 | def test_array |
General Comments 0
You need to be logged in to leave comments.
Login now