aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller
diff options
context:
space:
mode:
authorJamis Buck <jamis@37signals.com>2006-10-14 01:54:42 +0000
committerJamis Buck <jamis@37signals.com>2006-10-14 01:54:42 +0000
commitef6921628d4906fcd2945f2f90b050ff5b5ec258 (patch)
treeff54525b5aeb3f7598c1b1f6ebe52104d06bb023 /actionpack/test/controller
parent81ddeadd4962f110d51a073a270c844407222593 (diff)
downloadrails-ef6921628d4906fcd2945f2f90b050ff5b5ec258.tar.gz
rails-ef6921628d4906fcd2945f2f90b050ff5b5ec258.tar.bz2
rails-ef6921628d4906fcd2945f2f90b050ff5b5ec258.zip
make sure filters in subclasses with :only or :except conditions are treated like skip_filter calls
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5301 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r--actionpack/test/controller/filters_test.rb14
1 files changed, 13 insertions, 1 deletions
diff --git a/actionpack/test/controller/filters_test.rb b/actionpack/test/controller/filters_test.rb
index a098840486..3a74eba04a 100644
--- a/actionpack/test/controller/filters_test.rb
+++ b/actionpack/test/controller/filters_test.rb
@@ -20,7 +20,15 @@ class FilterTest < Test::Unit::TestCase
@ran_after_filter << "clean_up"
end
end
-
+
+ class ChangingTheRequirementsController < TestController
+ before_filter :ensure_login, :except => [:go_wild]
+
+ def go_wild
+ render :text => "gobble"
+ end
+ end
+
class TestMultipleFiltersController < ActionController::Base
before_filter :try_1
before_filter :try_2
@@ -423,6 +431,10 @@ class FilterTest < Test::Unit::TestCase
assert_equal %w( conditional_in_parent conditional_in_parent ), test_process(ChildOfConditionalParentController).template.assigns['ran_filter']
end
+ def test_changing_the_requirements
+ assert_equal nil, test_process(ChangingTheRequirementsController, "go_wild").template.assigns['ran_filter']
+ end
+
private
def test_process(controller, action = "show")
request = ActionController::TestRequest.new