Defect #41819 ยป 41819.patch
| app/views/timelog/index.api.rsb | ||
|---|---|---|
|
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
|
||
| app/views/timelog/show.api.rsb | ||
|---|---|---|
|
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
|
||
| test/integration/api_test/time_entries_test.rb | ||
|---|---|---|
|
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'
|
||
|
end
|
||
|
test "GET /time_entries.xml with limit should return limited results" do
|
||
| ... | ... | |
|
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
|
||