mirror of
https://github.com/meineerde/redmine.git
synced 2026-02-01 03:57:15 +00:00
Fix wrong variable name in Import#set_default_settings (#34718).
git-svn-id: http://svn.redmine.org/redmine/trunk@21354 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
e00f28e82e
commit
4fbbcf3cdf
@ -72,7 +72,7 @@ class Import < ActiveRecord::Base
|
||||
|
||||
separator = [',', ';'].max_by {|sep| content.count(sep)}
|
||||
|
||||
guessed_encoding = Redmine::CodesetUtil.guess_encoding(file_content)
|
||||
guessed_encoding = Redmine::CodesetUtil.guess_encoding(content)
|
||||
encoding =
|
||||
(guessed_encoding && (
|
||||
Setting::ENCODINGS.detect {|e| e.casecmp?(guessed_encoding)} ||
|
||||
|
||||
@ -414,6 +414,9 @@ class IssueImportTest < ActiveSupport::TestCase
|
||||
|
||||
def test_set_default_settings_should_guess_encoding
|
||||
import = generate_import('import_iso8859-1.csv')
|
||||
user = User.generate!(:language => 'ja')
|
||||
import.user = user
|
||||
assert_equal 'CP932', lu(user, :general_csv_encoding)
|
||||
with_settings :repositories_encodings => 'UTF-8,ISO-8859-1' do
|
||||
import.set_default_settings
|
||||
guessed_encoding = import.settings['encoding']
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user