diff options
author | wycats <wycats@gmail.com> | 2010-08-15 16:29:27 -0700 |
---|---|---|
committer | wycats <wycats@gmail.com> | 2010-08-15 16:31:24 -0700 |
commit | aaec0072922166442457ded88c39cb5372ea5e67 (patch) | |
tree | b6e670d7d9a47b6e384c8d609aa57e7c306fa56f /railties/test | |
parent | a1fdf402c02f4ae8ef0b49c2481298565620efa6 (diff) | |
download | rails-aaec0072922166442457ded88c39cb5372ea5e67.tar.gz rails-aaec0072922166442457ded88c39cb5372ea5e67.tar.bz2 rails-aaec0072922166442457ded88c39cb5372ea5e67.zip |
Make sure apps upgrading from 2.3 get defaulted to UTF-8 (ht: parndt)
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/application/configuration_test.rb | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/railties/test/application/configuration_test.rb b/railties/test/application/configuration_test.rb index 9928ee2c52..d63d25b42e 100644 --- a/railties/test/application/configuration_test.rb +++ b/railties/test/application/configuration_test.rb @@ -172,17 +172,27 @@ module ApplicationTests assert $prepared end + def assert_utf8 + if RUBY_VERSION < '1.9' + assert_equal "UTF8", $KCODE + else + assert_equal Encoding::UTF_8, Encoding.default_external + assert_equal Encoding::UTF_8, Encoding.default_internal + end + end + + test "skipping config.encoding still results in 'utf-8' as the default" do + require "#{app_path}/config/application" + assert_utf8 + end + test "config.encoding sets the default encoding" do add_to_config <<-RUBY config.encoding = "utf-8" RUBY require "#{app_path}/config/application" - - unless RUBY_VERSION < '1.9' - assert_equal Encoding::UTF_8, Encoding.default_external - assert_equal Encoding::UTF_8, Encoding.default_internal - end + assert_utf8 end test "config.paths.public sets Rails.public_path" do |