]> source.dussan.org Git - redmine.git/commitdiff
Merged r14015 (#19065).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Wed, 18 Feb 2015 11:42:11 +0000 (11:42 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Wed, 18 Feb 2015 11:42:11 +0000 (11:42 +0000)
git-svn-id: http://svn.redmine.org/redmine/branches/2.6-stable@14024 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/views/builders/xml.rb
test/integration/api_test/issues_test.rb

index 37fd25d391c593540cceda8310c909f69ed53a88..9f80a608818df81f88973784902c5656a813c398 100644 (file)
@@ -30,9 +30,10 @@ module Redmine
           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
index 6b81c6e4f9c06ff05df4d0f831ac0ec80a630bd5..029bdb8c3432d9b39b448d98cca736a1ada9db92 100644 (file)
@@ -162,6 +162,15 @@ class Redmine::ApiTest::IssuesTest < Redmine::ApiTest::Base
     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
+
   def test_index_should_include_issue_attributes
     get '/issues.xml'
     assert_select 'issues>issue>is_private', :text => 'false'