diff options
author | Angelo capilleri <capilleri@yahoo.com> | 2013-11-29 12:26:12 +0100 |
---|---|---|
committer | Angelo Capilleri <capilleri@yahoo.com> | 2013-12-03 07:46:39 +0100 |
commit | 43962d6ec50f918c9970bd3cd4b6ee5c7f7426ed (patch) | |
tree | dd773bd243dc9542b2042c0122beb4bc83cfaef5 /actionpack/test | |
parent | 6eba8d27e6feecca88303df6500ef6b376344e29 (diff) | |
download | rails-43962d6ec50f918c9970bd3cd4b6ee5c7f7426ed.tar.gz rails-43962d6ec50f918c9970bd3cd4b6ee5c7f7426ed.tar.bz2 rails-43962d6ec50f918c9970bd3cd4b6ee5c7f7426ed.zip |
Fix header Content-Type: #<Mime::NullType:...> in localized template
This PR fixes #13064 regression bug introduced by the #8085
Now in _process_format when the format is a Mime::NullType nothing is written in self.content_type.
In this way the method Response#assign_default_content_type_and_charset can
write the the default mime_type.
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/localized_templates_test.rb | 11 | ||||
-rw-r--r-- | actionpack/test/fixtures/localized/hello_world.it.erb | 1 |
2 files changed, 12 insertions, 0 deletions
diff --git a/actionpack/test/controller/localized_templates_test.rb b/actionpack/test/controller/localized_templates_test.rb index 6b02eedaed..c95ef8a0c7 100644 --- a/actionpack/test/controller/localized_templates_test.rb +++ b/actionpack/test/controller/localized_templates_test.rb @@ -34,4 +34,15 @@ class LocalizedTemplatesTest < ActionController::TestCase get :hello_world assert_equal "Gutten Tag", @response.body end + + def test_localized_template_has_correct_header_with_no_format_in_template_name + old_locale = I18n.locale + I18n.locale = :it + + get :hello_world + assert_equal "Ciao Mondo", @response.body + assert_equal "text/html", @response.content_type + ensure + I18n.locale = old_locale + end end diff --git a/actionpack/test/fixtures/localized/hello_world.it.erb b/actionpack/test/fixtures/localized/hello_world.it.erb new file mode 100644 index 0000000000..9191fdc187 --- /dev/null +++ b/actionpack/test/fixtures/localized/hello_world.it.erb @@ -0,0 +1 @@ +Ciao Mondo
\ No newline at end of file |