diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-02-19 20:01:00 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-02-19 20:01:00 +0000 |
commit | af92686c62c33d5566241d619b06b03f82ecb269 (patch) | |
tree | 0b7989ac32161c2c768d81d5f2b6df4547983c12 /test | |
parent | 59c704dcd2a22c43a51a588ea82d85dd3d58ce87 (diff) | |
download | redmine-af92686c62c33d5566241d619b06b03f82ecb269.tar.gz redmine-af92686c62c33d5566241d619b06b03f82ecb269.zip |
Fixed that float custom fields do not use CSV decimal separator (#10364).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11441 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/issues_controller_test.rb | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb index 8a147ad49..65e28b570 100644 --- a/test/functional/issues_controller_test.rb +++ b/test/functional/issues_controller_test.rb @@ -433,6 +433,25 @@ class IssuesControllerTest < ActionController::TestCase assert lines.detect {|line| line.include?('"MySQL, Oracle"')} end + def test_index_csv_should_format_float_custom_fields_with_csv_decimal_separator + field = IssueCustomField.create!(:name => 'Float', :is_for_all => true, :tracker_ids => [1], :field_format => 'float') + issue = Issue.generate!(:project_id => 1, :tracker_id => 1, :custom_field_values => {field.id => '185.6'}) + + with_settings :default_language => 'fr' do + get :index, :format => 'csv', :columns => 'all' + assert_response :success + issue_line = response.body.chomp.split("\n").map {|line| line.split(';')}.detect {|line| line[0]==issue.id.to_s} + assert_include '185,60', issue_line + end + + with_settings :default_language => 'en' do + get :index, :format => 'csv', :columns => 'all' + assert_response :success + issue_line = response.body.chomp.split("\n").map {|line| line.split(',')}.detect {|line| line[0]==issue.id.to_s} + assert_include '185.60', issue_line + end + end + def test_index_csv_big_5 with_settings :default_language => "zh-TW" do str_utf8 = "\xe4\xb8\x80\xe6\x9c\x88" @@ -453,8 +472,8 @@ class IssuesControllerTest < ActionController::TestCase if str_utf8.respond_to?(:force_encoding) s1.force_encoding('Big5') end - assert lines[0].include?(s1) - assert lines[1].include?(str_big5) + assert_include s1, lines[0] + assert_include str_big5, lines[1] end end |