mirror of
https://github.com/redmine/redmine.git
synced 2025-11-08 14:26:04 +01:00
ApiTest fails if config.time_zone is set (#31388).
Patch by Yuichi HARADA. git-svn-id: http://svn.redmine.org/redmine/trunk@18237 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -40,12 +40,12 @@ class Redmine::ApiTest::ApiTest < Redmine::ApiTest::Base
|
|||||||
|
|
||||||
def test_json_datetime_format
|
def test_json_datetime_format
|
||||||
get '/users/1.json', :headers => credentials('admin')
|
get '/users/1.json', :headers => credentials('admin')
|
||||||
assert_include '"created_on":"2006-07-19T17:12:21Z"', response.body
|
assert_include %Q|"created_on":"#{Time.zone.parse('2006-07-19T17:12:21Z').iso8601}"|, response.body
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_xml_datetime_format
|
def test_xml_datetime_format
|
||||||
get '/users/1.xml', :headers => credentials('admin')
|
get '/users/1.xml', :headers => credentials('admin')
|
||||||
assert_include '<created_on>2006-07-19T17:12:21Z</created_on>', response.body
|
assert_include "<created_on>#{Time.zone.parse('2006-07-19T17:12:21Z').iso8601}</created_on>", response.body
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_head_response_should_have_empty_body
|
def test_head_response_should_have_empty_body
|
||||||
|
|||||||
@@ -211,10 +211,10 @@ class Redmine::ApiTest::IssuesTest < Redmine::ApiTest::Base
|
|||||||
test "GET /issues/:id.xml with journals should format timestamps in ISO 8601" do
|
test "GET /issues/:id.xml with journals should format timestamps in ISO 8601" do
|
||||||
get '/issues/1.xml?include=journals'
|
get '/issues/1.xml?include=journals'
|
||||||
|
|
||||||
iso_date = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$/
|
issue = Issue.find(1)
|
||||||
assert_select 'issue>created_on', :text => iso_date
|
assert_select 'issue>created_on', :text => issue.created_on.iso8601
|
||||||
assert_select 'issue>updated_on', :text => iso_date
|
assert_select 'issue>updated_on', :text => issue.updated_on.iso8601
|
||||||
assert_select 'issue journal>created_on', :text => iso_date
|
assert_select 'issue journal>created_on', :text => issue.journals[0].created_on.iso8601
|
||||||
end
|
end
|
||||||
|
|
||||||
test "GET /issues/:id.xml with custom fields" do
|
test "GET /issues/:id.xml with custom fields" do
|
||||||
|
|||||||
Reference in New Issue
Block a user