diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2015-03-15 18:13:46 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2015-03-15 18:13:46 +0000 |
commit | b089d4104a29027ae3128482ab6f96ca1da2905e (patch) | |
tree | a27bc99b48ae5cf4a0dd0051beb3a06e3233f067 /test | |
parent | 2f78c8a7ec28064c7d2413e32f215d987c2e9d88 (diff) | |
download | redmine-b089d4104a29027ae3128482ab6f96ca1da2905e.tar.gz redmine-b089d4104a29027ae3128482ab6f96ca1da2905e.zip |
Merged r14112 (#19305).
git-svn-id: http://svn.redmine.org/redmine/branches/3.0-stable@14113 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/setting_test.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/unit/setting_test.rb b/test/unit/setting_test.rb index 46383e867..6c3c27df9 100644 --- a/test/unit/setting_test.rb +++ b/test/unit/setting_test.rb @@ -1,3 +1,5 @@ +# encoding: utf-8 +# # Redmine - project management software # Copyright (C) 2006-2015 Jean-Philippe Lang # @@ -101,4 +103,25 @@ class SettingTest < ActiveSupport::TestCase assert_equal [10, 25, 50], Setting.per_page_options_array end end + + def test_setting_serialied_as_binary_should_be_loaded_as_utf8_encoded_strings + yaml = <<-YAML +--- +- keywords: !binary | + Zml4ZXMsY2xvc2VzLNC40YHQv9GA0LDQstC70LXQvdC+LNCz0L7RgtC+0LLQ + vizRgdC00LXQu9Cw0L3QvixmaXhlZA== + + done_ratio: "100" + status_id: "5" +YAML + + Setting.commit_update_keywords = {} + assert_equal 1, Setting.where(:name => 'commit_update_keywords').update_all(:value => yaml) + Setting.clear_cache + + assert_equal 'UTF-8', Setting.commit_update_keywords.first['keywords'].encoding.name + ensure + Setting.where(:name => 'commit_update_keywords').delete_all + Setting.clear_cache + end end |