diff options
author | Andrew White <andrew.white@unboxed.co> | 2018-02-27 11:07:04 +0000 |
---|---|---|
committer | Andrew White <andrew.white@unboxed.co> | 2018-02-27 15:03:50 +0000 |
commit | 96eeea538c9c5b7b60d6f8baed2e86a9e2a920c9 (patch) | |
tree | 0dd707fe4f9e13b99ef967e479146ed6273832af /railties/test/application | |
parent | f86b221a53e8363b7c8a5688df603fc388b62b7c (diff) | |
download | rails-96eeea538c9c5b7b60d6f8baed2e86a9e2a920c9.tar.gz rails-96eeea538c9c5b7b60d6f8baed2e86a9e2a920c9.tar.bz2 rails-96eeea538c9c5b7b60d6f8baed2e86a9e2a920c9.zip |
Don't enforce UTF-8 by default
With the disabling of TLS 1.0 by most major websites, continuing to run
IE8 or lower becomes increasingly difficult so default to not enforcing
UTF-8 encoding as it's not relevant to other browsers.
Diffstat (limited to 'railties/test/application')
-rw-r--r-- | railties/test/application/configuration_test.rb | 36 |
1 files changed, 31 insertions, 5 deletions
diff --git a/railties/test/application/configuration_test.rb b/railties/test/application/configuration_test.rb index caadae3136..bd9b87467c 100644 --- a/railties/test/application/configuration_test.rb +++ b/railties/test/application/configuration_test.rb @@ -1766,7 +1766,7 @@ module ApplicationTests test "represent_boolean_as_integer should be able to set via config.active_record.sqlite3.represent_boolean_as_integer" do remove_from_config '.*config\.load_defaults.*\n' - app_file "config/initializers/new_framework_defaults_5_2.rb", <<-RUBY + app_file "config/initializers/new_framework_defaults_6_0.rb", <<-RUBY Rails.application.config.active_record.sqlite3.represent_boolean_as_integer = true RUBY @@ -1905,8 +1905,8 @@ module ApplicationTests test "ActiveSupport::MessageEncryptor.use_authenticated_message_encryption can be configured via config.active_support.use_authenticated_message_encryption" do remove_from_config '.*config\.load_defaults.*\n' - app_file "config/initializers/new_framework_defaults_5_2.rb", <<-RUBY - Rails.application.config.active_support.use_authenticated_message_encryption = true + app_file "config/initializers/new_framework_defaults_6_0.rb", <<-RUBY + Rails.application.config.active_support.use_authenticated_message_encryption = true RUBY app "development" @@ -1931,8 +1931,8 @@ module ApplicationTests test "ActiveSupport::Digest.hash_digest_class can be configured via config.active_support.use_sha1_digests" do remove_from_config '.*config\.load_defaults.*\n' - app_file "config/initializers/new_framework_defaults_5_2.rb", <<-RUBY - Rails.application.config.active_support.use_sha1_digests = true + app_file "config/initializers/new_framework_defaults_6_0.rb", <<-RUBY + Rails.application.config.active_support.use_sha1_digests = true RUBY app "development" @@ -1952,6 +1952,32 @@ module ApplicationTests assert_includes ActiveJob::Serializers.serializers, DummySerializer end + test "ActionView::Helpers::FormTagHelper.default_enforce_utf8 is false by default" do + app "development" + assert_equal false, ActionView::Helpers::FormTagHelper.default_enforce_utf8 + end + + test "ActionView::Helpers::FormTagHelper.default_enforce_utf8 is true in an upgraded app" do + remove_from_config '.*config\.load_defaults.*\n' + add_to_config 'config.load_defaults "5.2"' + + app "development" + + assert_equal true, ActionView::Helpers::FormTagHelper.default_enforce_utf8 + end + + test "ActionView::Helpers::FormTagHelper.default_enforce_utf8 can be configured via config.action_view.default_enforce_utf8" do + remove_from_config '.*config\.load_defaults.*\n' + + app_file "config/initializers/new_framework_defaults_6_0.rb", <<-RUBY + Rails.application.config.action_view.default_enforce_utf8 = true + RUBY + + app "development" + + assert_equal true, ActionView::Helpers::FormTagHelper.default_enforce_utf8 + end + private def force_lazy_load_hooks yield # Tasty clarifying sugar, homie! We only need to reference a constant to load it. |