From 2ecc678ed6ab60c1bdc7dce67c0c908542c5008d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Sun, 1 Feb 2009 09:43:39 +0100 Subject: Added localized rescue (404.da.html) [#1835 state:committed] Signed-off-by: David Heinemeier Hansson --- actionpack/test/controller/rescue_test.rb | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'actionpack/test/controller/rescue_test.rb') diff --git a/actionpack/test/controller/rescue_test.rb b/actionpack/test/controller/rescue_test.rb index 9f6b45f065..85c2a4c1bb 100644 --- a/actionpack/test/controller/rescue_test.rb +++ b/actionpack/test/controller/rescue_test.rb @@ -199,6 +199,31 @@ class RescueControllerTest < ActionController::TestCase end end + def test_rescue_action_in_public_with_localized_error_file + # Reload and register danish language for testing + I18n.reload! + I18n.backend.store_translations 'da', {} + + # Ensure original are still the same since we are reindexing view paths + assert_equal ORIGINAL_LOCALES, I18n.available_locales.map(&:to_s).sort + + # Change locale + old_locale = I18n.locale + I18n.locale = :da + + with_rails_root FIXTURE_PUBLIC do + with_all_requests_local false do + get :raises + end + end + + assert_response :internal_server_error + body = File.read("#{FIXTURE_PUBLIC}/public/500.da.html") + assert_equal body, @response.body + ensure + I18n.locale = old_locale + end + def test_rescue_action_in_public_with_error_file with_rails_root FIXTURE_PUBLIC do with_all_requests_local false do -- cgit v1.2.3