Permalink
Browse files

Failed test for Marcel to ponder

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4178 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 0f0d926 commit 42d8548e94395435ccc00b453a4db65aca157726 @dhh dhh committed Apr 6, 2006
Showing with 10 additions and 2 deletions.
  1. +10 −2 actionpack/test/controller/filters_test.rb
@@ -117,6 +117,8 @@ def wonderful_life
class ConditionalSkippingController < TestController
skip_before_filter :ensure_login, :only => [ :login ]
skip_after_filter :clean_up, :only => [ :login ]
+
+ before_filter :find_user, :only => [ :change_password ]
def login
render :inline => "ran action"
@@ -125,6 +127,12 @@ def login
def change_password
render :inline => "ran action"
end
+
+ protected
+ def find_user
+ @ran_filter ||= []
+ @ran_filter << "find_user"
+ end
end
class ConditionalParentOfConditionalSkippingController < ConditionalFilterController
@@ -382,7 +390,7 @@ def test_dynamic_dispatch
def test_conditional_skipping_of_filters
assert_nil test_process(ConditionalSkippingController, "login").template.assigns["ran_filter"]
- assert_equal %w( ensure_login ), test_process(ConditionalSkippingController, "change_password").template.assigns["ran_filter"]
+ assert_equal %w( ensure_login find_user ), test_process(ConditionalSkippingController, "change_password").template.assigns["ran_filter"]
assert_nil test_process(ConditionalSkippingController, "login").template.controller.instance_variable_get("@ran_after_filter")
assert_equal %w( clean_up ), test_process(ConditionalSkippingController, "change_password").template.controller.instance_variable_get("@ran_after_filter")
@@ -392,7 +400,7 @@ def test_conditional_skipping_of_filters_when_parent_filter_is_also_conditional
assert_equal %w( conditional_in_parent conditional_in_parent ), test_process(ChildOfConditionalParentController).template.assigns['ran_filter']
assert_nil test_process(ChildOfConditionalParentController, 'another_action').template.assigns['ran_filter']
end
-
+
private
def test_process(controller, action = "show")
request = ActionController::TestRequest.new

0 comments on commit 42d8548

Please sign in to comment.