mirror of
https://github.com/redmine/redmine.git
synced 2025-11-07 22:05:56 +01:00
Missing thousands separator in Integer and Float custom field totals (#42342).
Patch by Katsuya HIDAKA (user:hidakatsuya). git-svn-id: https://svn.redmine.org/redmine/trunk@23559 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -2003,12 +2003,34 @@ class IssuesControllerTest < Redmine::ControllerTest
|
||||
|
||||
def test_index_with_int_custom_field_total
|
||||
field = IssueCustomField.generate!(:field_format => 'int', :is_for_all => true)
|
||||
CustomValue.create!(:customized => Issue.find(1), :custom_field => field, :value => '2')
|
||||
CustomValue.create!(:customized => Issue.find(2), :custom_field => field, :value => '7')
|
||||
get(:index, :params => {:t => ["cf_#{field.id}"]})
|
||||
CustomValue.create!(:customized => Issue.find(1), :custom_field => field, :value => '9800')
|
||||
CustomValue.create!(:customized => Issue.find(2), :custom_field => field, :value => '10')
|
||||
|
||||
field_with_delimiter = IssueCustomField.generate!(:field_format => 'int', :thousands_delimiter => '1', :is_for_all => true)
|
||||
CustomValue.create!(:customized => Issue.find(1), :custom_field => field_with_delimiter, :value => '9800')
|
||||
CustomValue.create!(:customized => Issue.find(2), :custom_field => field_with_delimiter, :value => '10')
|
||||
|
||||
get(:index, :params => {:t => ["cf_#{field.id}", "cf_#{field_with_delimiter.id}"]})
|
||||
assert_response :success
|
||||
assert_select '.query-totals'
|
||||
assert_select ".total-for-cf-#{field.id} span.value", :text => '9'
|
||||
assert_select ".total-for-cf-#{field.id} span.value", :text => '9810'
|
||||
assert_select ".total-for-cf-#{field_with_delimiter.id} span.value", :text => '9,810'
|
||||
end
|
||||
|
||||
def test_index_with_float_custom_field_total
|
||||
field = IssueCustomField.generate!(field_format: 'float', is_for_all: true)
|
||||
CustomValue.create!(customized: Issue.find(1), custom_field: field, value: '1000000.01')
|
||||
CustomValue.create!(customized: Issue.find(2), custom_field: field, value: '99.01')
|
||||
|
||||
field_with_delimiter = IssueCustomField.generate!(field_format: 'float', thousands_delimiter: '1', is_for_all: true)
|
||||
CustomValue.create!(customized: Issue.find(1), custom_field: field_with_delimiter, value: '1000000.01')
|
||||
CustomValue.create!(customized: Issue.find(2), custom_field: field_with_delimiter, value: '99.01')
|
||||
|
||||
get(:index, params: {t: ["cf_#{field.id}", "cf_#{field_with_delimiter.id}"]})
|
||||
assert_response :success
|
||||
assert_select '.query-totals'
|
||||
assert_select ".total-for-cf-#{field.id} span.value", text: '1000099.02'
|
||||
assert_select ".total-for-cf-#{field_with_delimiter.id} span.value", text: '1,000,099.02'
|
||||
end
|
||||
|
||||
def test_index_with_spent_time_total_should_sum_visible_spent_time_only
|
||||
|
||||
Reference in New Issue
Block a user