Defect #41819 ยป 41819.patch
app/views/timelog/index.api.rsb | ||
---|---|---|
6 | 6 |
api.issue(:id => time_entry.issue_id) unless time_entry.issue.nil? |
7 | 7 |
api.user(:id => time_entry.user_id, :name => time_entry.user.name) unless time_entry.user.nil? |
8 | 8 |
api.activity(:id => time_entry.activity_id, :name => time_entry.activity.name) unless time_entry.activity.nil? |
9 |
api.hours time_entry.hours |
|
9 |
api.hours time_entry.hours.round(2).to_f
|
|
10 | 10 |
api.comments time_entry.comments |
11 | 11 |
api.spent_on time_entry.spent_on |
12 | 12 |
api.created_on time_entry.created_on |
app/views/timelog/show.api.rsb | ||
---|---|---|
4 | 4 |
api.issue(:id => @time_entry.issue_id) unless @time_entry.issue.nil? |
5 | 5 |
api.user(:id => @time_entry.user_id, :name => @time_entry.user.name) unless @time_entry.user.nil? |
6 | 6 |
api.activity(:id => @time_entry.activity_id, :name => @time_entry.activity.name) unless @time_entry.activity.nil? |
7 |
api.hours @time_entry.hours |
|
7 |
api.hours @time_entry.hours.round(2).to_f
|
|
8 | 8 |
api.comments @time_entry.comments |
9 | 9 |
api.spent_on @time_entry.spent_on |
10 | 10 |
api.created_on @time_entry.created_on |
test/integration/api_test/time_entries_test.rb | ||
---|---|---|
33 | 33 |
get '/time_entries.xml', :headers => credentials('jsmith') |
34 | 34 |
assert_response :success |
35 | 35 |
assert_equal 'application/xml', @response.media_type |
36 |
assert_select 'time_entries[type=array] time_entry id', :text => '2' |
|
36 |
assert_select 'time_entries[type=array] time_entry id', :text => '4' |
|
37 |
assert_select 'time_entry:has(id:contains(4)) hours', :text => '7.65' |
|
37 | 38 |
end |
38 | 39 | |
39 | 40 |
test "GET /time_entries.xml with limit should return limited results" do |
... | ... | |
44 | 45 |
end |
45 | 46 | |
46 | 47 |
test "GET /time_entries/:id.xml should return the time entry" do |
47 |
get '/time_entries/2.xml', :headers => credentials('jsmith')
|
|
48 |
get '/time_entries/4.xml', :headers => credentials('jsmith')
|
|
48 | 49 |
assert_response :success |
49 | 50 |
assert_equal 'application/xml', @response.media_type |
50 |
assert_select 'time_entry id', :text => '2' |
|
51 |
assert_select 'time_entry id', :text => '4' |
|
52 |
assert_select 'time_entry hours', :text => '7.65' |
|
51 | 53 |
end |
52 | 54 | |
53 | 55 |
test "GET /time_entries/:id.xml on closed project should return the time entry" do |