aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/filters_test.rb
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2015-02-24 14:59:28 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2015-02-24 14:59:28 -0300
commitefc6d49114f3cf140d2349876eb5a9ea8ff3383c (patch)
tree76f1798290a99f1662706ed1d7a10384cdf6f123 /actionpack/test/controller/filters_test.rb
parentf6a31f532167eaffe0709af50c2d2190f2f76219 (diff)
downloadrails-efc6d49114f3cf140d2349876eb5a9ea8ff3383c.tar.gz
rails-efc6d49114f3cf140d2349876eb5a9ea8ff3383c.tar.bz2
rails-efc6d49114f3cf140d2349876eb5a9ea8ff3383c.zip
Use other controller instead of sharing the controller
Diffstat (limited to 'actionpack/test/controller/filters_test.rb')
-rw-r--r--actionpack/test/controller/filters_test.rb35
1 files changed, 17 insertions, 18 deletions
diff --git a/actionpack/test/controller/filters_test.rb b/actionpack/test/controller/filters_test.rb
index 1485d740c8..26b94f0db8 100644
--- a/actionpack/test/controller/filters_test.rb
+++ b/actionpack/test/controller/filters_test.rb
@@ -25,27 +25,26 @@ class ActionController::Base
end
end
-class TestController < ActionController::Base
- before_action :ensure_login
- after_action :clean_up
-
- def show
- render :inline => "ran action"
- end
+class FilterTest < ActionController::TestCase
+ class TestController < ActionController::Base
+ before_action :ensure_login
+ after_action :clean_up
- private
- def ensure_login
- @ran_filter ||= []
- @ran_filter << "ensure_login"
+ def show
+ render :inline => "ran action"
end
- def clean_up
- @ran_after_action ||= []
- @ran_after_action << "clean_up"
- end
-end
+ private
+ def ensure_login
+ @ran_filter ||= []
+ @ran_filter << "ensure_login"
+ end
-class FilterTest < ActionController::TestCase
+ def clean_up
+ @ran_after_action ||= []
+ @ran_after_action << "clean_up"
+ end
+ end
class ChangingTheRequirementsController < TestController
before_action :ensure_login, :except => [:go_wild]
@@ -1069,7 +1068,7 @@ class YieldingAroundFiltersTest < ActionController::TestCase
def test_deprecated_skip_action_callback
assert_deprecated do
- Class.new(TestController) do
+ Class.new(PostsController) do
skip_action_callback :clean_up
end
end