diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2006-09-05 21:28:22 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2006-09-05 21:28:22 +0000 |
commit | 9598176390b624bece9c4e2f9aecb68e0cc95871 (patch) | |
tree | 0bece04bb338accb42b6ac9b237324ad3b46c279 /actionpack | |
parent | 85fbb22f071b96d5a20ac71dc16d4432c08cdcf3 (diff) | |
download | rails-9598176390b624bece9c4e2f9aecb68e0cc95871.tar.gz rails-9598176390b624bece9c4e2f9aecb68e0cc95871.tar.bz2 rails-9598176390b624bece9c4e2f9aecb68e0cc95871.zip |
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
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_controller/assertions.rb | 33 | ||||
-rw-r--r-- | actionpack/lib/action_controller/integration.rb | 2 |
2 files changed, 20 insertions, 15 deletions
diff --git a/actionpack/lib/action_controller/assertions.rb b/actionpack/lib/action_controller/assertions.rb index 4eab8f9ffd..f3d4558e92 100644 --- a/actionpack/lib/action_controller/assertions.rb +++ b/actionpack/lib/action_controller/assertions.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 @@ require File.dirname(__FILE__) + '/assertions/deprecated_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
\ No newline at end of file diff --git a/actionpack/lib/action_controller/integration.rb b/actionpack/lib/action_controller/integration.rb index 57872e8e8b..a7736de113 100644 --- a/actionpack/lib/action_controller/integration.rb +++ b/actionpack/lib/action_controller/integration.rb @@ -13,7 +13,7 @@ module ActionController # 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. |