mirror of
https://github.com/redmine/redmine.git
synced 2025-11-12 08:16:03 +01:00
format_hours method produces incorrect output for negative time values when Setting.timespan_format is "minutes" (#42172).
Patch by Go MAEDA (user:maeda). git-svn-id: https://svn.redmine.org/redmine/trunk@23482 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -2210,11 +2210,15 @@ class ApplicationHelperTest < Redmine::HelperTest
|
||||
set_language_if_valid 'en'
|
||||
|
||||
with_settings :timespan_format => 'minutes' do
|
||||
assert_equal '-0:45', format_hours(-0.75)
|
||||
assert_equal '0:00', format_hours(0)
|
||||
assert_equal '0:45', format_hours(0.75)
|
||||
assert_equal '0:45 h', l_hours_short(0.75)
|
||||
assert_equal '0:45 hour', l_hours(0.75)
|
||||
end
|
||||
with_settings :timespan_format => 'decimal' do
|
||||
assert_equal '-0.75', format_hours(-0.75)
|
||||
assert_equal '0.00', format_hours(0)
|
||||
assert_equal '0.75', format_hours(0.75)
|
||||
assert_equal '0.75 h', l_hours_short(0.75)
|
||||
assert_equal '0.75 hour', l_hours(0.75)
|
||||
|
||||
Reference in New Issue
Block a user