target!
end
- def method_missing(sym, *args, &block)
+ # Overrides Builder::XmlBase#tag! to format timestamps in ISO 8601
+ def tag!(sym, *args, &block)
if args.size == 1 && args.first.is_a?(::Time)
- __send__ sym, args.first.xmlschema, &block
+ tag! sym, args.first.xmlschema, &block
else
super
end
end
end
+ test "GET /issues/:id.xml with journals should format timestamps in ISO 8601" do
+ get '/issues/1.xml?include=journals'
+
+ iso_date = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$/
+ assert_select 'issue>created_on', :text => iso_date
+ assert_select 'issue>updated_on', :text => iso_date
+ assert_select 'issue journal>created_on', :text => iso_date
+ end
+
test "GET /issues/:id.xml with custom fields" do
get '/issues/3.xml'