Move generic assertions into ActionDispatch

This commit is contained in:
Joshua Peek 2009-04-30 11:55:53 -05:00
parent 98dd726687
commit 7b3b7cb2ab
11 changed files with 19 additions and 14 deletions

View File

@ -14,7 +14,7 @@ module ActionController
# Integration::Session directly.
class Session
include Test::Unit::Assertions
include ActionController::TestCase::Assertions
include ActionDispatch::Assertions
include ActionController::TestProcess
# The integer HTTP status code of the last request.

View File

@ -105,12 +105,7 @@ module ActionController
class TestCase < ActiveSupport::TestCase
include TestProcess
module Assertions
%w(response selector tag dom routing model).each do |kind|
include ActionController::Assertions.const_get("#{kind.camelize}Assertions")
end
end
include Assertions
include ActionDispatch::Assertions
# When the request.remote_addr remains the default for testing, which is 0.0.0.0, the exception is simply raised inline
# (bystepping the regular exception handling from rescue_action). If the request.remote_addr is anything else, the regular

View File

@ -45,6 +45,8 @@ module ActionDispatch
autoload :Reloader, 'action_dispatch/middleware/reloader'
autoload :MiddlewareStack, 'action_dispatch/middleware/stack'
autoload :Assertions, 'action_dispatch/testing/assertions'
module Http
autoload :Headers, 'action_dispatch/http/headers'
end

View File

@ -0,0 +1,8 @@
module ActionDispatch
module Assertions
%w(response selector tag dom routing model).each do |kind|
require "action_dispatch/testing/assertions/#{kind}"
include const_get("#{kind.camelize}Assertions")
end
end
end

View File

@ -1,4 +1,4 @@
module ActionController
module ActionDispatch
module Assertions
module DomAssertions
# Test two HTML strings for equivalency (e.g., identical up to reordering of attributes)

View File

@ -1,4 +1,4 @@
module ActionController
module ActionDispatch
module Assertions
module ModelAssertions
# Ensures that the passed record is valid by Active Record standards and

View File

@ -1,4 +1,4 @@
module ActionController
module ActionDispatch
module Assertions
# A small suite of assertions that test responses from Rails applications.
module ResponseAssertions

View File

@ -1,4 +1,4 @@
module ActionController
module ActionDispatch
module Assertions
# Suite of assertions to test routes generated by Rails and the handling of requests made to them.
module RoutingAssertions

View File

@ -3,7 +3,7 @@
# Under MIT and/or CC By license.
#++
module ActionController
module ActionDispatch
module Assertions
unless const_defined?(:NO_STRIP)
NO_STRIP = %w{pre script style textarea}

View File

@ -1,4 +1,4 @@
module ActionController
module ActionDispatch
module Assertions
# Pair of assertions to testing elements in the HTML output of the response.
module TagAssertions

View File

@ -21,7 +21,7 @@ module ActionView
end
class TestCase < ActiveSupport::TestCase
include ActionController::TestCase::Assertions
include ActionDispatch::Assertions
include ActionController::TestProcess
class_inheritable_accessor :helper_class