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