From ba4744d4c48e21f3f640fca860993e36998e943d Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Tue, 6 Jun 2017 20:56:47 +0000 Subject: Merged r16572 (#25861). git-svn-id: http://svn.redmine.org/redmine/branches/3.2-stable@16618 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/functional/imports_controller_test.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test/functional') diff --git a/test/functional/imports_controller_test.rb b/test/functional/imports_controller_test.rb index 9c8dafa34..28c06baa9 100644 --- a/test/functional/imports_controller_test.rb +++ b/test/functional/imports_controller_test.rb @@ -100,6 +100,17 @@ class ImportsControllerTest < ActionController::TestCase assert_select 'div#flash_error', /not a valid UTF-8 encoded file/ end + def test_post_settings_with_invalid_encoding_should_display_error + import = generate_import('invalid-Shift_JIS.csv') + + post :settings, :id => import.to_param, + :import_settings => {:separator => ";", :wrapper => '"', :encoding => "Shift_JIS"} + assert_response 200 + import.reload + assert_nil import.total_items + assert_select 'div#flash_error', /not a valid Shift_JIS encoded file/ + end + def test_get_mapping_should_display_mapping_form import = generate_import('import_iso8859-1.csv') import.settings = {'separator' => ";", 'wrapper' => '"', 'encoding' => "ISO-8859-1"} -- cgit v1.2.3