@@ -32,7 +32,7 module Redmine #:nodoc: | |||||
32 | end |
|
32 | end | |
33 | # 2,5 => 2.5 |
|
33 | # 2,5 => 2.5 | |
34 | s.gsub!(',', '.') |
|
34 | s.gsub!(',', '.') | |
35 | s.to_f |
|
35 | begin; Kernel.Float(s); rescue; nil; end | |
36 | end |
|
36 | end | |
37 | end |
|
37 | end | |
38 | end |
|
38 | end |
@@ -169,13 +169,15 class IssuesControllerTest < Test::Unit::TestCase | |||||
169 | :issue => {:tracker_id => 1, |
|
169 | :issue => {:tracker_id => 1, | |
170 | :subject => 'This is the test_new issue', |
|
170 | :subject => 'This is the test_new issue', | |
171 | :description => 'This is the description', |
|
171 | :description => 'This is the description', | |
172 |
:priority_id => 5 |
|
172 | :priority_id => 5, | |
|
173 | :estimated_hours => ''}, | |||
173 | :custom_fields => {'2' => 'Value for field 2'} |
|
174 | :custom_fields => {'2' => 'Value for field 2'} | |
174 | assert_redirected_to 'issues/show' |
|
175 | assert_redirected_to 'issues/show' | |
175 |
|
176 | |||
176 | issue = Issue.find_by_subject('This is the test_new issue') |
|
177 | issue = Issue.find_by_subject('This is the test_new issue') | |
177 | assert_not_nil issue |
|
178 | assert_not_nil issue | |
178 | assert_equal 2, issue.author_id |
|
179 | assert_equal 2, issue.author_id | |
|
180 | assert_nil issue.estimated_hours | |||
179 | v = issue.custom_values.find_by_custom_field_id(2) |
|
181 | v = issue.custom_values.find_by_custom_field_id(2) | |
180 | assert_not_nil v |
|
182 | assert_not_nil v | |
181 | assert_equal 'Value for field 2', v.value |
|
183 | assert_equal 'Value for field 2', v.value | |
@@ -254,10 +256,13 class IssuesControllerTest < Test::Unit::TestCase | |||||
254 | issue = Issue.find(1) |
|
256 | issue = Issue.find(1) | |
255 | assert_equal 1, issue.status_id |
|
257 | assert_equal 1, issue.status_id | |
256 | @request.session[:user_id] = 2 |
|
258 | @request.session[:user_id] = 2 | |
257 | post :edit, |
|
259 | assert_difference('TimeEntry.count', 0) do | |
258 | :id => 1, |
|
260 | post :edit, | |
259 | :issue => { :status_id => 2, :assigned_to_id => 3 }, |
|
261 | :id => 1, | |
260 | :notes => 'Assigned to dlopper' |
|
262 | :issue => { :status_id => 2, :assigned_to_id => 3 }, | |
|
263 | :notes => 'Assigned to dlopper', | |||
|
264 | :time_entry => { :hours => '', :comments => '', :activity_id => Enumeration.get_values('ACTI').first } | |||
|
265 | end | |||
261 | assert_redirected_to 'issues/show/1' |
|
266 | assert_redirected_to 'issues/show/1' | |
262 | issue.reload |
|
267 | issue.reload | |
263 | assert_equal 2, issue.status_id |
|
268 | assert_equal 2, issue.status_id | |
@@ -288,10 +293,12 class IssuesControllerTest < Test::Unit::TestCase | |||||
288 | def test_post_edit_with_note_and_spent_time |
|
293 | def test_post_edit_with_note_and_spent_time | |
289 | @request.session[:user_id] = 2 |
|
294 | @request.session[:user_id] = 2 | |
290 | spent_hours_before = Issue.find(1).spent_hours |
|
295 | spent_hours_before = Issue.find(1).spent_hours | |
291 | post :edit, |
|
296 | assert_difference('TimeEntry.count') do | |
292 | :id => 1, |
|
297 | post :edit, | |
293 | :notes => '2.5 hours added', |
|
298 | :id => 1, | |
294 | :time_entry => { :hours => '2.5', :comments => '', :activity_id => Enumeration.get_values('ACTI').first } |
|
299 | :notes => '2.5 hours added', | |
|
300 | :time_entry => { :hours => '2.5', :comments => '', :activity_id => Enumeration.get_values('ACTI').first } | |||
|
301 | end | |||
295 | assert_redirected_to 'issues/show/1' |
|
302 | assert_redirected_to 'issues/show/1' | |
296 |
|
303 | |||
297 | issue = Issue.find(1) |
|
304 | issue = Issue.find(1) |
General Comments 0
You need to be logged in to leave comments.
Login now