diff options
author | Rolf Timmermans <r.timmermans@voormedia.com> | 2011-03-27 17:18:32 +0200 |
---|---|---|
committer | Rolf Timmermans <r.timmermans@voormedia.com> | 2011-03-27 17:18:32 +0200 |
commit | 512057d386075f207d8927a5e0ce3943174d5c78 (patch) | |
tree | c0b9122469af1e4af74142cc2cad6d560226753c /actionpack/test/controller | |
parent | d89a7967b5af5c87bbfc268af72287b82541d384 (diff) | |
parent | a9d27c04abf24dc85be061ff9772d71897af02b1 (diff) | |
download | rails-512057d386075f207d8927a5e0ce3943174d5c78.tar.gz rails-512057d386075f207d8927a5e0ce3943174d5c78.tar.bz2 rails-512057d386075f207d8927a5e0ce3943174d5c78.zip |
Merge remote-tracking branch 'upstream/master' into desc_tracker
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r-- | actionpack/test/controller/filters_test.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/actionpack/test/controller/filters_test.rb b/actionpack/test/controller/filters_test.rb index 330fa276d0..9e44e8e088 100644 --- a/actionpack/test/controller/filters_test.rb +++ b/actionpack/test/controller/filters_test.rb @@ -505,6 +505,21 @@ class FilterTest < ActionController::TestCase end end + class ImplicitActionsController < ActionController::Base + before_filter :find_only, :only => :edit + before_filter :find_except, :except => :edit + + private + + def find_only + @only = 'Only' + end + + def find_except + @except = 'Except' + end + end + def test_sweeper_should_not_block_rendering response = test_process(SweeperTestController) assert_equal 'hello world', response.body @@ -783,6 +798,18 @@ class FilterTest < ActionController::TestCase assert_equal("I rescued this: #<FilterTest::ErrorToRescue: Something made the bad noise.>", response.body) end + def test_filters_obey_only_and_except_for_implicit_actions + test_process(ImplicitActionsController, 'show') + assert_equal 'Except', assigns(:except) + assert_nil assigns(:only) + assert_equal 'show', response.body + + test_process(ImplicitActionsController, 'edit') + assert_equal 'Only', assigns(:only) + assert_nil assigns(:except) + assert_equal 'edit', response.body + end + private def test_process(controller, action = "show") @controller = controller.is_a?(Class) ? controller.new : controller |