Fixed: Updating tickets add a time log with zero hours (#1147).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1385 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
4525a7429a
commit
f1ae453688
|
@ -32,7 +32,7 @@ module Redmine #:nodoc:
|
||||||
end
|
end
|
||||||
# 2,5 => 2.5
|
# 2,5 => 2.5
|
||||||
s.gsub!(',', '.')
|
s.gsub!(',', '.')
|
||||||
s.to_f
|
begin; Kernel.Float(s); rescue; nil; end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -169,13 +169,15 @@ class IssuesControllerTest < Test::Unit::TestCase
|
||||||
:issue => {:tracker_id => 1,
|
:issue => {:tracker_id => 1,
|
||||||
:subject => 'This is the test_new issue',
|
:subject => 'This is the test_new issue',
|
||||||
:description => 'This is the description',
|
:description => 'This is the description',
|
||||||
:priority_id => 5},
|
:priority_id => 5,
|
||||||
|
:estimated_hours => ''},
|
||||||
:custom_fields => {'2' => 'Value for field 2'}
|
:custom_fields => {'2' => 'Value for field 2'}
|
||||||
assert_redirected_to 'issues/show'
|
assert_redirected_to 'issues/show'
|
||||||
|
|
||||||
issue = Issue.find_by_subject('This is the test_new issue')
|
issue = Issue.find_by_subject('This is the test_new issue')
|
||||||
assert_not_nil issue
|
assert_not_nil issue
|
||||||
assert_equal 2, issue.author_id
|
assert_equal 2, issue.author_id
|
||||||
|
assert_nil issue.estimated_hours
|
||||||
v = issue.custom_values.find_by_custom_field_id(2)
|
v = issue.custom_values.find_by_custom_field_id(2)
|
||||||
assert_not_nil v
|
assert_not_nil v
|
||||||
assert_equal 'Value for field 2', v.value
|
assert_equal 'Value for field 2', v.value
|
||||||
|
@ -254,10 +256,13 @@ class IssuesControllerTest < Test::Unit::TestCase
|
||||||
issue = Issue.find(1)
|
issue = Issue.find(1)
|
||||||
assert_equal 1, issue.status_id
|
assert_equal 1, issue.status_id
|
||||||
@request.session[:user_id] = 2
|
@request.session[:user_id] = 2
|
||||||
post :edit,
|
assert_difference('TimeEntry.count', 0) do
|
||||||
:id => 1,
|
post :edit,
|
||||||
:issue => { :status_id => 2, :assigned_to_id => 3 },
|
:id => 1,
|
||||||
:notes => 'Assigned to dlopper'
|
:issue => { :status_id => 2, :assigned_to_id => 3 },
|
||||||
|
:notes => 'Assigned to dlopper',
|
||||||
|
:time_entry => { :hours => '', :comments => '', :activity_id => Enumeration.get_values('ACTI').first }
|
||||||
|
end
|
||||||
assert_redirected_to 'issues/show/1'
|
assert_redirected_to 'issues/show/1'
|
||||||
issue.reload
|
issue.reload
|
||||||
assert_equal 2, issue.status_id
|
assert_equal 2, issue.status_id
|
||||||
|
@ -288,10 +293,12 @@ class IssuesControllerTest < Test::Unit::TestCase
|
||||||
def test_post_edit_with_note_and_spent_time
|
def test_post_edit_with_note_and_spent_time
|
||||||
@request.session[:user_id] = 2
|
@request.session[:user_id] = 2
|
||||||
spent_hours_before = Issue.find(1).spent_hours
|
spent_hours_before = Issue.find(1).spent_hours
|
||||||
post :edit,
|
assert_difference('TimeEntry.count') do
|
||||||
:id => 1,
|
post :edit,
|
||||||
:notes => '2.5 hours added',
|
:id => 1,
|
||||||
:time_entry => { :hours => '2.5', :comments => '', :activity_id => Enumeration.get_values('ACTI').first }
|
:notes => '2.5 hours added',
|
||||||
|
:time_entry => { :hours => '2.5', :comments => '', :activity_id => Enumeration.get_values('ACTI').first }
|
||||||
|
end
|
||||||
assert_redirected_to 'issues/show/1'
|
assert_redirected_to 'issues/show/1'
|
||||||
|
|
||||||
issue = Issue.find(1)
|
issue = Issue.find(1)
|
||||||
|
|
Loading…
Reference in New Issue