csv 1.0.2 gem breaks ImportsControllerTest
This issue is reproducible only on Ruby 2.5 because csv gem is used for Ruby 2.5 only (see r17245). No problem with csv 1.0.1.
$ ruby test/functional/imports_controller_test.rb Run options: --seed 38551 # Running: .......F Failure: ImportsControllerTest#test_post_settings_with_wrong_encoding_should_display_error [test/functional/imports_controller_test.rb:125]: <(?-mix:not a valid UTF-8 encoded file)> expected but was <The file is not a CSV file or does not match the settings below>.. Expected 0 to be >= 1. bin/rails test test/functional/imports_controller_test.rb:111
#3 Updated by Go MAEDA over 2 years ago
- Category changed from Ruby support to Gems support
The cause of this issue is the changed behavior of csv gem. csv gem 1.0.2 throws MalformedCSVError instead of ArgumentError if the library find invalid byte sequences in a CSV file. As a result, Redmine displays the error :error_invalid_csv_file_or_settings instead of :error_invalid_file_encoding.
The behavior has changed by this commit.
The current versions of Redmine expect ArgumentError if the parameter and file encoding does not much.