mirror of
https://github.com/redmine/redmine.git
synced 2026-02-21 05:57:49 +01:00
Merged r23304 from trunk to 6.0-stable (#41819).
git-svn-id: https://svn.redmine.org/redmine/branches/6.0-stable@23310 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -6,7 +6,7 @@ api.array :time_entries, api_meta(:total_count => @entry_count, :offset => @offs
|
||||
api.issue(:id => time_entry.issue_id) unless time_entry.issue.nil?
|
||||
api.user(:id => time_entry.user_id, :name => time_entry.user.name) unless time_entry.user.nil?
|
||||
api.activity(:id => time_entry.activity_id, :name => time_entry.activity.name) unless time_entry.activity.nil?
|
||||
api.hours time_entry.hours
|
||||
api.hours time_entry.hours.round(2).to_f
|
||||
api.comments time_entry.comments
|
||||
api.spent_on time_entry.spent_on
|
||||
api.created_on time_entry.created_on
|
||||
|
||||
@@ -4,7 +4,7 @@ api.time_entry do
|
||||
api.issue(:id => @time_entry.issue_id) unless @time_entry.issue.nil?
|
||||
api.user(:id => @time_entry.user_id, :name => @time_entry.user.name) unless @time_entry.user.nil?
|
||||
api.activity(:id => @time_entry.activity_id, :name => @time_entry.activity.name) unless @time_entry.activity.nil?
|
||||
api.hours @time_entry.hours
|
||||
api.hours @time_entry.hours.round(2).to_f
|
||||
api.comments @time_entry.comments
|
||||
api.spent_on @time_entry.spent_on
|
||||
api.created_on @time_entry.created_on
|
||||
|
||||
@@ -33,7 +33,9 @@ class Redmine::ApiTest::TimeEntriesTest < Redmine::ApiTest::Base
|
||||
get '/time_entries.xml', :headers => credentials('jsmith')
|
||||
assert_response :success
|
||||
assert_equal 'application/xml', @response.media_type
|
||||
assert_select 'time_entries[type=array] time_entry id', :text => '2'
|
||||
assert_select 'time_entries[type=array] time_entry id', :text => '4'
|
||||
assert_select 'time_entry:has(id:contains(4)) hours', :text => '7.65'
|
||||
assert_select 'time_entry:has(id:contains(3)) hours', :text => '1.0'
|
||||
end
|
||||
|
||||
test "GET /time_entries.xml with limit should return limited results" do
|
||||
@@ -44,10 +46,11 @@ class Redmine::ApiTest::TimeEntriesTest < Redmine::ApiTest::Base
|
||||
end
|
||||
|
||||
test "GET /time_entries/:id.xml should return the time entry" do
|
||||
get '/time_entries/2.xml', :headers => credentials('jsmith')
|
||||
get '/time_entries/4.xml', :headers => credentials('jsmith')
|
||||
assert_response :success
|
||||
assert_equal 'application/xml', @response.media_type
|
||||
assert_select 'time_entry id', :text => '2'
|
||||
assert_select 'time_entry id', :text => '4'
|
||||
assert_select 'time_entry hours', :text => '7.65'
|
||||
end
|
||||
|
||||
test "GET /time_entries/:id.xml on closed project should return the time entry" do
|
||||
|
||||
Reference in New Issue
Block a user