mirror of https://github.com/rails/rails
Move generic assertions into ActionDispatch
This commit is contained in:
parent
98dd726687
commit
7b3b7cb2ab
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
|
@ -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)
|
|
@ -1,4 +1,4 @@
|
|||
module ActionController
|
||||
module ActionDispatch
|
||||
module Assertions
|
||||
module ModelAssertions
|
||||
# Ensures that the passed record is valid by Active Record standards and
|
|
@ -1,4 +1,4 @@
|
|||
module ActionController
|
||||
module ActionDispatch
|
||||
module Assertions
|
||||
# A small suite of assertions that test responses from Rails applications.
|
||||
module ResponseAssertions
|
|
@ -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
|
|
@ -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}
|
|
@ -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
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue