From f6a31f532167eaffe0709af50c2d2190f2f76219 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Tue, 24 Feb 2015 14:14:15 -0300 Subject: Make TestController available to all test classes --- actionpack/test/controller/filters_test.rb | 32 +++++++++++++++--------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'actionpack/test') diff --git a/actionpack/test/controller/filters_test.rb b/actionpack/test/controller/filters_test.rb index 94faaeec69..1485d740c8 100644 --- a/actionpack/test/controller/filters_test.rb +++ b/actionpack/test/controller/filters_test.rb @@ -25,27 +25,27 @@ class ActionController::Base end end -class FilterTest < ActionController::TestCase +class TestController < ActionController::Base + before_action :ensure_login + after_action :clean_up - class TestController < ActionController::Base - before_action :ensure_login - after_action :clean_up + def show + render :inline => "ran action" + end - def show - render :inline => "ran action" + private + def ensure_login + @ran_filter ||= [] + @ran_filter << "ensure_login" end - private - def ensure_login - @ran_filter ||= [] - @ran_filter << "ensure_login" - end + def clean_up + @ran_after_action ||= [] + @ran_after_action << "clean_up" + end +end - def clean_up - @ran_after_action ||= [] - @ran_after_action << "clean_up" - end - end +class FilterTest < ActionController::TestCase class ChangingTheRequirementsController < TestController before_action :ensure_login, :except => [:go_wild] -- cgit v1.2.3