|
|
@@ -102,6 +102,17 @@ class ImportsControllerTest < Redmine::ControllerTest |
|
|
|
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"} |