aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/layout_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test/controller/layout_test.rb')
-rw-r--r--actionpack/test/controller/layout_test.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/actionpack/test/controller/layout_test.rb b/actionpack/test/controller/layout_test.rb
index 28555ee3d1..1575674e18 100644
--- a/actionpack/test/controller/layout_test.rb
+++ b/actionpack/test/controller/layout_test.rb
@@ -79,6 +79,10 @@ end
class DefaultLayoutController < LayoutTest
end
+class AbsolutePathLayoutController < LayoutTest
+ layout File.expand_path(File.expand_path(__FILE__) + '/../../fixtures/layout_tests/layouts/layout_test.rhtml')
+end
+
class HasOwnLayoutController < LayoutTest
layout 'item'
end
@@ -137,12 +141,18 @@ class LayoutSetInResponseTest < ActionController::TestCase
ensure
ActionController::Base.exempt_from_layout.delete(/\.rhtml$/)
end
-
+
def test_layout_is_picked_from_the_controller_instances_view_path
@controller = PrependsViewPathController.new
get :hello
assert_equal 'layouts/alt', @response.layout
end
+
+ def test_absolute_pathed_layout
+ @controller = AbsolutePathLayoutController.new
+ get :hello
+ assert_equal "layout_test.rhtml hello.rhtml", @response.body.strip
+ end
end
class RenderWithTemplateOptionController < LayoutTest