aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller
diff options
context:
space:
mode:
authorMarcel Molina <marcel@vernix.org>2006-01-15 11:28:55 +0000
committerMarcel Molina <marcel@vernix.org>2006-01-15 11:28:55 +0000
commit4793a2f5cdc07a5926e8399fd82a835c0dc0a023 (patch)
tree422a9724779a3ce0be13774eb8598b7a7e70a805 /actionpack/test/controller
parenta471e6b4d741c498439767237efad9838df44834 (diff)
downloadrails-4793a2f5cdc07a5926e8399fd82a835c0dc0a023.tar.gz
rails-4793a2f5cdc07a5926e8399fd82a835c0dc0a023.tar.bz2
rails-4793a2f5cdc07a5926e8399fd82a835c0dc0a023.zip
Automatically discover layouts when a controller is namespaced. Closes #2199, #3424.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3423 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r--actionpack/test/controller/layout_test.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/actionpack/test/controller/layout_test.rb b/actionpack/test/controller/layout_test.rb
index 57eb1f73b1..cffd4d388e 100644
--- a/actionpack/test/controller/layout_test.rb
+++ b/actionpack/test/controller/layout_test.rb
@@ -20,6 +20,12 @@ end
class ThirdPartyTemplateLibraryController < LayoutTest
end
+module ControllerNameSpace
+end
+
+class ControllerNameSpace::NestedController < LayoutTest
+end
+
class MabView
def initialize(view)
end
@@ -57,5 +63,12 @@ class LayoutAutoDiscoveryTest < Test::Unit::TestCase
assert_equal 'layouts/third_party_template_library', @controller.active_layout
assert_equal 'Mab', @response.body
end
+
+ def test_namespaced_controllers_auto_detect_layouts
+ @controller = ControllerNameSpace::NestedController.new
+ get :hello
+ assert_equal 'layouts/controller_name_space/nested', @controller.active_layout
+ assert_equal 'controller_name_space/nested.rhtml hello.rhtml', @response.body
+ end
end \ No newline at end of file