diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-02-24 14:14:15 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-02-24 14:14:15 -0300 |
commit | f6a31f532167eaffe0709af50c2d2190f2f76219 (patch) | |
tree | 8f3120c81957a09ba73828758b3c226b4d444c5d /actionpack | |
parent | 6976e1da07ac91f5e17c6bc02758122255d94d48 (diff) | |
download | rails-f6a31f532167eaffe0709af50c2d2190f2f76219.tar.gz rails-f6a31f532167eaffe0709af50c2d2190f2f76219.tar.bz2 rails-f6a31f532167eaffe0709af50c2d2190f2f76219.zip |
Make TestController available to all test classes
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/test/controller/filters_test.rb | 32 |
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] |