From c51aa9f6f2c361e1efc53020028592564318e8a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20Emin=20=C4=B0NA=C3=87?= Date: Tue, 7 Apr 2015 17:18:59 +0300 Subject: fix for actionview parent layout bug This commit fixes issue #19626 Don't need to check layout conditions if there is no condition test for parent layout bug fix --- actionview/test/actionpack/controller/layout_test.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'actionview/test') diff --git a/actionview/test/actionpack/controller/layout_test.rb b/actionview/test/actionpack/controller/layout_test.rb index 7b8a83e2fe..64ab125637 100644 --- a/actionview/test/actionpack/controller/layout_test.rb +++ b/actionview/test/actionpack/controller/layout_test.rb @@ -122,6 +122,14 @@ class PrependsViewPathController < LayoutTest end end +class ParentController < LayoutTest + layout 'item' +end + +class ChildController < ParentController + layout 'layout_test', only: :hello +end + class OnlyLayoutController < LayoutTest layout 'item', :only => "hello" end @@ -225,6 +233,12 @@ class LayoutSetInResponseTest < ActionController::TestCase get :hello assert_equal "layout_test.erb hello.erb", @response.body.strip end + + def test_respect_to_parent_layout + @controller = ChildController.new + get :goodbye + assert_template :layout => "layouts/item" + end end class SetsNonExistentLayoutFile < LayoutTest -- cgit v1.2.3