mirror of
https://github.com/redmine/redmine.git
synced 2025-11-18 03:00:52 +01:00
Support for nested array in API builder.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8720 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -46,6 +46,19 @@ class Redmine::Views::Builders::XmlTest < ActiveSupport::TestCase
|
||||
end
|
||||
end
|
||||
|
||||
def test_nested_arrays
|
||||
assert_xml_output('<books type="array"><book><authors type="array"><author>B. Smith</author><author>G. Cooper</author></authors></book></books>') do |b|
|
||||
b.array :books do |books|
|
||||
books.book do |book|
|
||||
book.array :authors do |authors|
|
||||
authors.author 'B. Smith'
|
||||
authors.author 'G. Cooper'
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def assert_xml_output(expected, &block)
|
||||
builder = Redmine::Views::Builders::Xml.new
|
||||
block.call(builder)
|
||||
|
||||
Reference in New Issue
Block a user