Upgrade to Rails 2.0.2
Upgraded to Rails 2.0.2, except that we maintain vendor/rails/actionpack/lib/action_controller/routing.rb from Rail 1.2.6 (at least for now), so that Routes don't change. We still get to enjoy Rails's many new features. Also fixed a bug in Chunk-handling: disable WikiWord processing in tags (for real this time).
This commit is contained in:
parent
0f6889e09f
commit
6873fc8026
1083 changed files with 52810 additions and 41058 deletions
|
@ -1,4 +1,3 @@
|
|||
require 'test/unit'
|
||||
require 'test/unit/assertions'
|
||||
|
||||
module ActionController #:nodoc:
|
||||
|
@ -9,7 +8,7 @@ module ActionController #:nodoc:
|
|||
# * session: Objects being saved in the session.
|
||||
# * flash: The flash objects currently in the session.
|
||||
# * cookies: Cookies being sent to the user on this request.
|
||||
#
|
||||
#
|
||||
# These collections can be used just like any other hash:
|
||||
#
|
||||
# assert_not_nil assigns(:person) # makes sure that a @person instance variable was set
|
||||
|
@ -17,7 +16,7 @@ module ActionController #:nodoc:
|
|||
# assert flash.empty? # makes sure that there's nothing in the flash
|
||||
#
|
||||
# For historic reasons, the assigns hash uses string-based keys. So assigns[:person] won't work, but assigns["person"] will. To
|
||||
# appease our yearning for symbols, though, an alternative accessor has been deviced using a method call instead of index referencing.
|
||||
# appease our yearning for symbols, though, an alternative accessor has been devised using a method call instead of index referencing.
|
||||
# So assigns(:person) will work just like assigns["person"], but again, assigns[:person] will not work.
|
||||
#
|
||||
# On top of the collections, you have the complete url that a given action redirected to available in redirect_to_url.
|
||||
|
@ -39,44 +38,32 @@ module ActionController #:nodoc:
|
|||
#
|
||||
# == Testing named routes
|
||||
#
|
||||
# If you're using named routes, they can be easily tested using the original named routes methods straight in the test case.
|
||||
# Example:
|
||||
# If you're using named routes, they can be easily tested using the original named routes' methods straight in the test case.
|
||||
# Example:
|
||||
#
|
||||
# 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
|
||||
%w(response selector tag dom routing model).each do |kind|
|
||||
require "action_controller/assertions/#{kind}_assertions"
|
||||
klass.module_eval { include const_get("#{kind.camelize}Assertions") }
|
||||
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}/ }
|
||||
rescue Test::Unit::AssertionFailedError => error
|
||||
framework_path = Regexp.new(File.expand_path("#{File.dirname(__FILE__)}/assertions"))
|
||||
error.backtrace.reject! { |line| File.expand_path(line) =~ framework_path }
|
||||
raise
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
require File.dirname(__FILE__) + '/assertions/response_assertions'
|
||||
require File.dirname(__FILE__) + '/assertions/selector_assertions'
|
||||
require File.dirname(__FILE__) + '/assertions/tag_assertions'
|
||||
require File.dirname(__FILE__) + '/assertions/dom_assertions'
|
||||
require File.dirname(__FILE__) + '/assertions/routing_assertions'
|
||||
require File.dirname(__FILE__) + '/assertions/model_assertions'
|
||||
require File.dirname(__FILE__) + '/assertions/deprecated_assertions'
|
||||
|
||||
module Test #:nodoc:
|
||||
module Unit #:nodoc:
|
||||
class TestCase #:nodoc:
|
||||
include ActionController::Assertions
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue