Permalink
Browse files

Better bundling of new assertions and make integration tests work again

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5020 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
dhh committed Sep 5, 2006
1 parent 85fbb22 commit 9598176390b624bece9c4e2f9aecb68e0cc95871
Showing with 20 additions and 15 deletions.
  1. +19 −14 actionpack/lib/action_controller/assertions.rb
  2. +1 −1 actionpack/lib/action_controller/integration.rb
@@ -44,6 +44,24 @@ module ActionController #:nodoc:
#
# assert_redirected_to page_url(:title => 'foo')
module Assertions
+ def self.included(klass)
+ klass.class_eval do
+ include ActionController::Assertions::ResponseAssertions
+ include ActionController::Assertions::SelectorAssertions
+ include ActionController::Assertions::RoutingAssertions
+ include ActionController::Assertions::TagAssertions
+ include ActionController::Assertions::DomAssertions
+ include ActionController::Assertions::ModelAssertions
+ include ActionController::Assertions::DeprecatedAssertions
+ end
+ end
+
+ def clean_backtrace(&block)
+ yield
+ rescue Test::Unit::AssertionFailedError => e
+ path = File.expand_path(__FILE__)
+ raise Test::Unit::AssertionFailedError, e.message, e.backtrace.reject { |line| File.expand_path(line) =~ /#{path}/ }
+ end
end
end
@@ -58,20 +76,7 @@ module Assertions
module Test #:nodoc:
module Unit #:nodoc:
class TestCase #:nodoc:
- include ActionController::Assertions::ResponseAssertions
- include ActionController::Assertions::SelectorAssertions
- include ActionController::Assertions::RoutingAssertions
- include ActionController::Assertions::TagAssertions
- include ActionController::Assertions::DomAssertions
- include ActionController::Assertions::ModelAssertions
- include ActionController::Assertions::DeprecatedAssertions
-
- def clean_backtrace(&block)
- yield
- rescue AssertionFailedError => e
- path = File.expand_path(__FILE__)
- raise AssertionFailedError, e.message, e.backtrace.reject { |line| File.expand_path(line) =~ /#{path}/ }
- end
+ include ActionController::Assertions
end
end
end
@@ -13,7 +13,7 @@ module Integration #:nodoc:
# Typically, you will instantiate a new session using IntegrationTest#open_session,
# rather than instantiating Integration::Session directly.
class Session
- include Test::Unit::Assertions
+ include ActionController::Assertions
include ActionController::TestProcess
# The integer HTTP status code of the last request.

0 comments on commit 9598176

Please sign in to comment.