diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-04-18 09:08:03 -0700 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-04-18 09:08:03 -0700 |
commit | 296830ed0f8732c6779dcdfed0f0e3d59947e47c (patch) | |
tree | 900114e542088830f1eca2d6d3362823e82efc42 /actionpack/test | |
parent | dba6a078ee22264bd2d305fd30a7b9ba8d9af983 (diff) | |
parent | 14c196e5a3f78ea4672b691a09ba60524b31fb73 (diff) | |
download | rails-296830ed0f8732c6779dcdfed0f0e3d59947e47c.tar.gz rails-296830ed0f8732c6779dcdfed0f0e3d59947e47c.tar.bz2 rails-296830ed0f8732c6779dcdfed0f0e3d59947e47c.zip |
Merge pull request #10262 from printercu/patch-3
Avoid leak into controller's action_methods
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/abstract/layouts_test.rb | 6 |
1 files changed, 6 insertions, 0 deletions
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) |