aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2006-07-05 02:38:55 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2006-07-05 02:38:55 +0000
commit11c715a53fd6309c37883b7d44462cc0a66f3bba (patch)
treee806db190d63f9628a8c0fc91da5f6da61e7329f /actionpack/test/controller
parent73c80169c85d6405940dc6c45dcc0ccff9d689df (diff)
downloadrails-11c715a53fd6309c37883b7d44462cc0a66f3bba.tar.gz
rails-11c715a53fd6309c37883b7d44462cc0a66f3bba.tar.bz2
rails-11c715a53fd6309c37883b7d44462cc0a66f3bba.zip
Added exception handling of missing layouts (closes #5373) [chris@ozmm.org]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4550 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r--actionpack/test/controller/layout_test.rb21
1 files changed, 20 insertions, 1 deletions
diff --git a/actionpack/test/controller/layout_test.rb b/actionpack/test/controller/layout_test.rb
index 9dc0cdcfe9..bbb13d0320 100644
--- a/actionpack/test/controller/layout_test.rb
+++ b/actionpack/test/controller/layout_test.rb
@@ -121,4 +121,23 @@ class LayoutSetInResponseTest < Test::Unit::TestCase
get :hello
assert_nil @response.layout
end
-end \ No newline at end of file
+end
+
+
+class SetsNonExistentLayoutFile < LayoutTest
+ layout "nofile.rhtml"
+end
+
+class LayoutExceptionRaised < Test::Unit::TestCase
+ def setup
+ @request = ActionController::TestRequest.new
+ @response = ActionController::TestResponse.new
+ end
+
+ def test_exception_raised_when_layout_file_not_found
+ @controller = SetsNonExistentLayoutFile.new
+ get :hello
+ @response.template.class.module_eval { attr_accessor :exception }
+ assert_equal ActionController::MissingTemplate, @response.template.exception.class
+ end
+end