diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2010-09-25 08:24:55 +0800 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-09-26 02:13:44 +0800 |
commit | ff3f55ee583743abf03a75d221216614e7ccd5e8 (patch) | |
tree | 50100f3de414fa4a9f45dbde48f9517a64e83d92 | |
parent | f405df6e57350552d4514e1c72587890ca22a8bb (diff) | |
download | rails-ff3f55ee583743abf03a75d221216614e7ccd5e8.tar.gz rails-ff3f55ee583743abf03a75d221216614e7ccd5e8.tar.bz2 rails-ff3f55ee583743abf03a75d221216614e7ccd5e8.zip |
There is no need to open AC::Base three times to setup tests.
-rw-r--r-- | actionpack/test/abstract_unit.rb | 47 |
1 files changed, 20 insertions, 27 deletions
diff --git a/actionpack/test/abstract_unit.rb b/actionpack/test/abstract_unit.rb index 7080a87f42..13f05651bc 100644 --- a/actionpack/test/abstract_unit.rb +++ b/actionpack/test/abstract_unit.rb @@ -274,33 +274,20 @@ class Rack::TestCase < ActionController::IntegrationTest end end -class ActionController::Base - def self.test_routes(&block) - routes = ActionDispatch::Routing::RouteSet.new - routes.draw(&block) - include routes.url_helpers - end -end - -class ::ApplicationController < ActionController::Base -end - -module ActionView - class TestCase - # Must repeat the setup because AV::TestCase is a duplication - # of AC::TestCase - setup do - @routes = SharedTestRoutes - end - end -end - module ActionController class Base include ActionController::Testing - end + # This stub emulates the Railtie including the URL helpers from a Rails application + include SharedTestRoutes.url_helpers - Base.view_paths = FIXTURE_LOAD_PATH + self.view_paths = FIXTURE_LOAD_PATH + + def self.test_routes(&block) + routes = ActionDispatch::Routing::RouteSet.new + routes.draw(&block) + include routes.url_helpers + end + end class TestCase include ActionDispatch::TestProcess @@ -311,9 +298,15 @@ module ActionController end end -# This stub emulates the Railtie including the URL helpers from a Rails application -module ActionController - class Base - include SharedTestRoutes.url_helpers +class ::ApplicationController < ActionController::Base +end + +module ActionView + class TestCase + # Must repeat the setup because AV::TestCase is a duplication + # of AC::TestCase + setup do + @routes = SharedTestRoutes + end end end |