aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test
diff options
context:
space:
mode:
authorMehmet Emin İNAÇ <mehmetemininac@gmail.com>2015-04-07 17:18:59 +0300
committerMehmet Emin İNAÇ <mehmetemininac@gmail.com>2015-04-08 11:39:29 +0300
commitc51aa9f6f2c361e1efc53020028592564318e8a6 (patch)
tree7e5785b99eff9376d86c72fd3c03fa0f1bec35af /actionview/test
parent060ee2c6c94cf7050bd8be22c79e053fd602579d (diff)
downloadrails-c51aa9f6f2c361e1efc53020028592564318e8a6.tar.gz
rails-c51aa9f6f2c361e1efc53020028592564318e8a6.tar.bz2
rails-c51aa9f6f2c361e1efc53020028592564318e8a6.zip
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
Diffstat (limited to 'actionview/test')
-rw-r--r--actionview/test/actionpack/controller/layout_test.rb14
1 files changed, 14 insertions, 0 deletions
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