mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Temporarily modifies setup to call super directly. This can support more T::U runners.
This commit is contained in:
parent
91402bdd31
commit
6c05b5e938
28 changed files with 54 additions and 4 deletions
|
@ -141,7 +141,9 @@ module ActionController
|
|||
end
|
||||
end
|
||||
|
||||
setup :setup_controller_request_and_response
|
||||
def setup
|
||||
setup_controller_request_and_response
|
||||
end
|
||||
|
||||
@@controller_class = nil
|
||||
|
||||
|
|
|
@ -168,11 +168,13 @@ end
|
|||
class ActionPackAssertionsControllerTest < ActionController::TestCase
|
||||
# let's get this party started
|
||||
def setup
|
||||
super
|
||||
ActionController::Routing::Routes.reload
|
||||
ActionController::Routing.use_controllers!(%w(action_pack_assertions admin/inner_module user content admin/user))
|
||||
end
|
||||
|
||||
def teardown
|
||||
super
|
||||
ActionController::Routing::Routes.reload
|
||||
end
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@ class AddressesTest < ActionController::TestCase
|
|||
tests AddressesTestController
|
||||
|
||||
def setup
|
||||
super
|
||||
# enable a logger so that (e.g.) the benchmarking stuff runs, so we can get
|
||||
# a more accurate simulation of what happens in "real life".
|
||||
@controller.logger = Logger.new(nil)
|
||||
|
|
|
@ -66,12 +66,14 @@ class AssertSelectTest < ActionController::TestCase
|
|||
tests AssertSelectController
|
||||
|
||||
def setup
|
||||
super
|
||||
ActionMailer::Base.delivery_method = :test
|
||||
ActionMailer::Base.perform_deliveries = true
|
||||
ActionMailer::Base.deliveries = []
|
||||
end
|
||||
|
||||
def teardown
|
||||
super
|
||||
ActionMailer::Base.deliveries.clear
|
||||
end
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@ class BenchmarkTest < ActionController::TestCase
|
|||
end
|
||||
|
||||
def setup
|
||||
super
|
||||
# benchmark doesn't do anything unless a logger is set
|
||||
@controller.logger = MockLogger.new
|
||||
@request.host = "test.actioncontroller.i"
|
||||
|
|
|
@ -44,6 +44,7 @@ end
|
|||
|
||||
class PageCachingTest < ActionController::TestCase
|
||||
def setup
|
||||
super
|
||||
ActionController::Base.perform_caching = true
|
||||
|
||||
ActionController::Routing::Routes.draw do |map|
|
||||
|
@ -224,6 +225,7 @@ end
|
|||
|
||||
class ActionCacheTest < ActionController::TestCase
|
||||
def setup
|
||||
super
|
||||
reset!
|
||||
FileUtils.mkdir_p(FILE_STORE_PATH)
|
||||
@path_class = ActionController::Caching::Actions::ActionCachePath
|
||||
|
@ -473,6 +475,7 @@ end
|
|||
|
||||
class FragmentCachingTest < ActionController::TestCase
|
||||
def setup
|
||||
super
|
||||
ActionController::Base.perform_caching = true
|
||||
@store = ActiveSupport::Cache::MemoryStore.new
|
||||
ActionController::Base.cache_store = @store
|
||||
|
@ -605,6 +608,7 @@ end
|
|||
|
||||
class FunctionalFragmentCachingTest < ActionController::TestCase
|
||||
def setup
|
||||
super
|
||||
ActionController::Base.perform_caching = true
|
||||
@store = ActiveSupport::Cache::MemoryStore.new
|
||||
ActionController::Base.cache_store = @store
|
||||
|
|
|
@ -27,6 +27,7 @@ class CaptureTest < ActionController::TestCase
|
|||
tests CaptureController
|
||||
|
||||
def setup
|
||||
super
|
||||
# enable a logger so that (e.g.) the benchmarking stuff runs, so we can get
|
||||
# a more accurate simulation of what happens in "real life".
|
||||
@controller.logger = Logger.new(nil)
|
||||
|
|
|
@ -54,6 +54,7 @@ class ContentTypeTest < ActionController::TestCase
|
|||
tests ContentTypeController
|
||||
|
||||
def setup
|
||||
super
|
||||
# enable a logger so that (e.g.) the benchmarking stuff runs, so we can get
|
||||
# a more accurate simulation of what happens in "real life".
|
||||
@controller.logger = Logger.new(nil)
|
||||
|
@ -136,10 +137,12 @@ class AcceptBasedContentTypeTest < ActionController::TestCase
|
|||
tests ContentTypeController
|
||||
|
||||
def setup
|
||||
super
|
||||
ActionController::Base.use_accept_header = true
|
||||
end
|
||||
|
||||
def teardown
|
||||
super
|
||||
ActionController::Base.use_accept_header = false
|
||||
end
|
||||
|
||||
|
|
|
@ -44,6 +44,7 @@ class CookieTest < ActionController::TestCase
|
|||
tests TestController
|
||||
|
||||
def setup
|
||||
super
|
||||
@request.host = "www.nextangle.com"
|
||||
end
|
||||
|
||||
|
|
|
@ -37,6 +37,7 @@ end
|
|||
|
||||
class LayoutAutoDiscoveryTest < ActionController::TestCase
|
||||
def setup
|
||||
super
|
||||
@request.host = "www.nextangle.com"
|
||||
end
|
||||
|
||||
|
|
|
@ -18,7 +18,10 @@ class LoggingTest < ActionController::TestCase
|
|||
end
|
||||
end
|
||||
|
||||
setup :set_logger
|
||||
def setup
|
||||
super
|
||||
set_logger
|
||||
end
|
||||
|
||||
def test_logging_without_parameters
|
||||
get :show
|
||||
|
|
|
@ -166,11 +166,13 @@ class MimeControllerTest < ActionController::TestCase
|
|||
tests RespondToController
|
||||
|
||||
def setup
|
||||
super
|
||||
ActionController::Base.use_accept_header = true
|
||||
@request.host = "www.example.com"
|
||||
end
|
||||
|
||||
def teardown
|
||||
super
|
||||
ActionController::Base.use_accept_header = false
|
||||
end
|
||||
|
||||
|
@ -511,6 +513,7 @@ class MimeControllerLayoutsTest < ActionController::TestCase
|
|||
tests PostController
|
||||
|
||||
def setup
|
||||
super
|
||||
@request.host = "www.example.com"
|
||||
end
|
||||
|
||||
|
|
|
@ -696,6 +696,7 @@ class RenderTest < ActionController::TestCase
|
|||
def setup
|
||||
# enable a logger so that (e.g.) the benchmarking stuff runs, so we can get
|
||||
# a more accurate simulation of what happens in "real life".
|
||||
super
|
||||
@controller.logger = Logger.new(nil)
|
||||
|
||||
@request.host = "www.nextangle.com"
|
||||
|
@ -1460,6 +1461,7 @@ class EtagRenderTest < ActionController::TestCase
|
|||
tests TestController
|
||||
|
||||
def setup
|
||||
super
|
||||
@request.host = "www.nextangle.com"
|
||||
@expected_bang_etag = etag_for(expand_key([:foo, 123]))
|
||||
end
|
||||
|
@ -1560,6 +1562,7 @@ class LastModifiedRenderTest < ActionController::TestCase
|
|||
tests TestController
|
||||
|
||||
def setup
|
||||
super
|
||||
@request.host = "www.nextangle.com"
|
||||
@last_modified = Time.now.utc.beginning_of_day.httpdate
|
||||
end
|
||||
|
@ -1615,6 +1618,7 @@ class RenderingLoggingTest < ActionController::TestCase
|
|||
tests TestController
|
||||
|
||||
def setup
|
||||
super
|
||||
@request.host = "www.nextangle.com"
|
||||
end
|
||||
|
||||
|
|
|
@ -143,8 +143,11 @@ end
|
|||
class RescueControllerTest < ActionController::TestCase
|
||||
FIXTURE_PUBLIC = "#{File.dirname(__FILE__)}/../fixtures".freeze
|
||||
|
||||
setup :set_all_requests_local
|
||||
setup :populate_exception_object
|
||||
def setup
|
||||
super
|
||||
set_all_requests_local
|
||||
populate_exception_object
|
||||
end
|
||||
|
||||
def set_all_requests_local
|
||||
RescueController.consider_all_requests_local = true
|
||||
|
|
|
@ -119,6 +119,7 @@ XML
|
|||
end
|
||||
|
||||
def setup
|
||||
super
|
||||
@controller = TestController.new
|
||||
@request = ActionController::TestRequest.new
|
||||
@response = ActionController::TestResponse.new
|
||||
|
@ -127,6 +128,7 @@ XML
|
|||
end
|
||||
|
||||
def teardown
|
||||
super
|
||||
ActionController::Routing::Routes.reload
|
||||
end
|
||||
|
||||
|
|
|
@ -88,6 +88,7 @@ class ActiveRecordHelperTest < ActionView::TestCase
|
|||
attr_accessor :request_forgery_protection_token, :form_authenticity_token
|
||||
|
||||
def setup
|
||||
super
|
||||
setup_post
|
||||
setup_user
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ class AssetTagHelperTest < ActionView::TestCase
|
|||
tests ActionView::Helpers::AssetTagHelper
|
||||
|
||||
def setup
|
||||
super
|
||||
silence_warnings do
|
||||
ActionView::Helpers::AssetTagHelper.send(
|
||||
:const_set,
|
||||
|
@ -629,6 +630,7 @@ class AssetTagHelperNonVhostTest < ActionView::TestCase
|
|||
tests ActionView::Helpers::AssetTagHelper
|
||||
|
||||
def setup
|
||||
super
|
||||
ActionController::Base.relative_url_root = "/collaboration/hieraki"
|
||||
|
||||
@controller = Class.new do
|
||||
|
|
|
@ -170,6 +170,7 @@ class AtomFeedTest < ActionController::TestCase
|
|||
tests ScrollsController
|
||||
|
||||
def setup
|
||||
super
|
||||
@request.host = "www.nextangle.com"
|
||||
end
|
||||
|
||||
|
|
|
@ -35,6 +35,7 @@ class FormHelperTest < ActionView::TestCase
|
|||
tests ActionView::Helpers::FormHelper
|
||||
|
||||
def setup
|
||||
super
|
||||
@post = Post.new
|
||||
@comment = Comment.new
|
||||
def @post.errors()
|
||||
|
|
|
@ -16,6 +16,7 @@ uses_mocha "FormOptionsHelperTest" do
|
|||
end
|
||||
|
||||
def setup
|
||||
super
|
||||
@fake_timezones = %w(A B C D E).inject([]) do |zones, id|
|
||||
tz = TZInfo::Timezone.loaded_zones[id] = stub(:name => id, :to_s => id)
|
||||
ActiveSupport::TimeZone.stubs(:[]).with(id).returns(tz)
|
||||
|
|
|
@ -4,6 +4,7 @@ class FormTagHelperTest < ActionView::TestCase
|
|||
tests ActionView::Helpers::FormTagHelper
|
||||
|
||||
def setup
|
||||
super
|
||||
@controller = Class.new do
|
||||
def url_for(options)
|
||||
"http://www.example.com"
|
||||
|
|
|
@ -6,6 +6,7 @@ class JavaScriptHelperTest < ActionView::TestCase
|
|||
attr_accessor :formats, :output_buffer
|
||||
|
||||
def setup
|
||||
super
|
||||
@template = self
|
||||
end
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@ class PrototypeHelperBaseTest < ActionView::TestCase
|
|||
attr_accessor :formats, :output_buffer
|
||||
|
||||
def setup
|
||||
super
|
||||
@template = self
|
||||
@controller = Class.new do
|
||||
def url_for(options)
|
||||
|
|
|
@ -13,6 +13,7 @@ class RecordTagHelperTest < ActionView::TestCase
|
|||
tests ActionView::Helpers::RecordTagHelper
|
||||
|
||||
def setup
|
||||
super
|
||||
@post = Post.new
|
||||
end
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ class ScriptaculousHelperTest < ActionView::TestCase
|
|||
tests ActionView::Helpers::ScriptaculousHelper
|
||||
|
||||
def setup
|
||||
super
|
||||
@controller = Class.new do
|
||||
def url_for(options)
|
||||
url = "http://www.example.com/"
|
||||
|
|
|
@ -20,6 +20,7 @@ end
|
|||
|
||||
class PeopleHelperTest < ActionView::TestCase
|
||||
def setup
|
||||
super
|
||||
ActionController::Routing::Routes.draw do |map|
|
||||
map.people 'people', :controller => 'people', :action => 'index'
|
||||
map.connect ':controller/:action/:id'
|
||||
|
|
|
@ -6,6 +6,7 @@ class TextHelperTest < ActionView::TestCase
|
|||
include TestingSandbox
|
||||
|
||||
def setup
|
||||
super
|
||||
# This simulates the fact that instance variables are reset every time
|
||||
# a view is rendered. The cycle helper depends on this behavior.
|
||||
@_cycles = nil if (defined? @_cycles)
|
||||
|
|
|
@ -7,6 +7,7 @@ class UrlHelperTest < ActionView::TestCase
|
|||
tests ActionView::Helpers::UrlHelper
|
||||
|
||||
def setup
|
||||
super
|
||||
@controller = Class.new do
|
||||
attr_accessor :url, :request
|
||||
def url_for(options)
|
||||
|
@ -347,6 +348,7 @@ class UrlHelperWithControllerTest < ActionView::TestCase
|
|||
tests ActionView::Helpers::UrlHelper
|
||||
|
||||
def setup
|
||||
super
|
||||
@request = ActionController::TestRequest.new
|
||||
@response = ActionController::TestResponse.new
|
||||
@controller = UrlHelperController.new
|
||||
|
@ -425,6 +427,7 @@ class LinkToUnlessCurrentWithControllerTest < ActionView::TestCase
|
|||
tests ActionView::Helpers::UrlHelper
|
||||
|
||||
def setup
|
||||
super
|
||||
@request = ActionController::TestRequest.new
|
||||
@response = ActionController::TestResponse.new
|
||||
@controller = TasksController.new
|
||||
|
@ -527,6 +530,7 @@ class PolymorphicControllerTest < ActionView::TestCase
|
|||
tests ActionView::Helpers::UrlHelper
|
||||
|
||||
def setup
|
||||
super
|
||||
@request = ActionController::TestRequest.new
|
||||
@response = ActionController::TestResponse.new
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue