From 14c196e5a3f78ea4672b691a09ba60524b31fb73 Mon Sep 17 00:00:00 2001 From: printercu Date: Thu, 18 Apr 2013 17:56:21 +0400 Subject: Avoid leak into controller's action_methods --- actionpack/test/abstract/layouts_test.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'actionpack/test/abstract') diff --git a/actionpack/test/abstract/layouts_test.rb b/actionpack/test/abstract/layouts_test.rb index 92baad4523..4a05c00f8b 100644 --- a/actionpack/test/abstract/layouts_test.rb +++ b/actionpack/test/abstract/layouts_test.rb @@ -8,6 +8,8 @@ module AbstractControllerTests include AbstractController::Rendering include AbstractController::Layouts + abstract! + self.view_paths = [ActionView::FixtureResolver.new( "layouts/hello.erb" => "With String <%= yield %>", "layouts/hello_override.erb" => "With Override <%= yield %>", @@ -251,6 +253,10 @@ module AbstractControllerTests assert_equal "Hello nil!", controller.response_body end + test "when layout is specified as a proc, do not leak any methods into controller's action_methods" do + assert_equal Set.new(['index']), WithProc.action_methods + end + test "when layout is specified as a proc, call it and use the layout returned" do controller = WithProc.new controller.process(:index) -- cgit v1.2.3