From ca2875fab2c3c3d96dcdbad5c3eb1068887dadd4 Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Mon, 7 May 2018 01:13:12 +0000 Subject: Allow switching the encoding to UTF-8 when exporting to CSV (#26279). Patch by Mizuki ISHIKAWA. git-svn-id: http://svn.redmine.org/redmine/trunk@17328 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/helpers/application_helper_test.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'test/helpers') diff --git a/test/helpers/application_helper_test.rb b/test/helpers/application_helper_test.rb index 78a4822f1..692c6c6bb 100644 --- a/test/helpers/application_helper_test.rb +++ b/test/helpers/application_helper_test.rb @@ -1607,4 +1607,20 @@ RAW assert_equal '0:45', html_hours('0:45') assert_equal '0.75', html_hours('0.75') end + + def test_export_csv_encoding_select_tag_should_return_nil_when_general_csv_encoding_is_UTF8 + with_locale 'az' do + assert_equal l(:general_csv_encoding), 'UTF-8' + assert_nil export_csv_encoding_select_tag + end + end + + def test_export_csv_encoding_select_tag_should_have_two_option_when_general_csv_encoding_is_not_UTF8 + with_locale 'en' do + assert_not_equal l(:general_csv_encoding), 'UTF-8' + result = export_csv_encoding_select_tag + assert_select_in result, "option[selected='selected'][value=#{l(:general_csv_encoding)}]", :text => l(:general_csv_encoding) + assert_select_in result, "option[value='UTF-8']", :text => 'UTF-8' + end + end end -- cgit v1.2.3