aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2015-02-24 14:14:15 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2015-02-24 14:14:15 -0300
commitf6a31f532167eaffe0709af50c2d2190f2f76219 (patch)
tree8f3120c81957a09ba73828758b3c226b4d444c5d /actionpack/test
parent6976e1da07ac91f5e17c6bc02758122255d94d48 (diff)
downloadrails-f6a31f532167eaffe0709af50c2d2190f2f76219.tar.gz
rails-f6a31f532167eaffe0709af50c2d2190f2f76219.tar.bz2
rails-f6a31f532167eaffe0709af50c2d2190f2f76219.zip
Make TestController available to all test classes
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/controller/filters_test.rb32
1 files changed, 16 insertions, 16 deletions
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]