- assert_equal content_type, response.content_type
- assert_equal "attachment; filename=\"#{trace.id}.#{extension}\"", @response.header["Content-Disposition"]
+ assert_equal content_type, response.media_type
+ assert_equal "attachment; filename=\"#{trace.id}.#{extension}\"; filename*=UTF-8''#{trace.id}.#{extension}", @response.header["Content-Disposition"]
+ end
+
+ ##
+ # build XML for traces
+ # this builds a minimum viable XML for the tests in this suite
+ def create_trace_xml(trace)
+ root = XML::Document.new
+ root.root = XML::Node.new "osm"
+ trc = XML::Node.new "gpx_file"
+ trc["id"] = trace.id.to_s
+ trc["visibility"] = trace.visibility
+ trc["visible"] = trace.visible.to_s
+ desc = XML::Node.new "description"
+ desc << trace.description
+ trc << desc
+ trace.tags.each do |tag|
+ t = XML::Node.new "tag"
+ t << tag.tag
+ trc << t
+ end
+ root.root << trc
+ root.to_s