Browse files

Move generic assertions into ActionDispatch

  • Loading branch information...
1 parent 98dd726 commit 7b3b7cb2ab1ccf96d4c8a1bafd87dbfbd2ac8c84 @josh josh committed Apr 30, 2009
View
2 actionpack/lib/action_controller/testing/integration.rb
@@ -14,7 +14,7 @@ module Integration #:nodoc:
# 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
7 actionpack/lib/action_controller/testing/test_case.rb
@@ -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
2 actionpack/lib/action_dispatch.rb
@@ -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
8 actionpack/lib/action_dispatch/testing/assertions.rb
@@ -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
2 ...tion_controller/testing/assertions/dom.rb → ...action_dispatch/testing/assertions/dom.rb
@@ -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
2 ...on_controller/testing/assertions/model.rb → ...tion_dispatch/testing/assertions/model.rb
@@ -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
2 ...controller/testing/assertions/response.rb → ...n_dispatch/testing/assertions/response.rb
@@ -1,4 +1,4 @@
-module ActionController
+module ActionDispatch
module Assertions
# A small suite of assertions that test responses from Rails applications.
module ResponseAssertions
View
2 ..._controller/testing/assertions/routing.rb → ...on_dispatch/testing/assertions/routing.rb
@@ -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
2 ...controller/testing/assertions/selector.rb → ...n_dispatch/testing/assertions/selector.rb
@@ -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
2 ...tion_controller/testing/assertions/tag.rb → ...action_dispatch/testing/assertions/tag.rb
@@ -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
2 actionpack/lib/action_view/test_case.rb
@@ -21,7 +21,7 @@ def _render_template(template, local_assigns = {})
end
class TestCase < ActiveSupport::TestCase
- include ActionController::TestCase::Assertions
+ include ActionDispatch::Assertions
include ActionController::TestProcess
class_inheritable_accessor :helper_class

0 comments on commit 7b3b7cb

Please sign in to comment.