Rails 2.1
Update to Rails 2.1 final.
This commit is contained in:
parent
fd554cce90
commit
516d6dfac0
257 changed files with 4058 additions and 1933 deletions
|
@ -1,7 +1,8 @@
|
|||
module ActionController
|
||||
module Assertions
|
||||
module ModelAssertions
|
||||
# Ensures that the passed record is valid by ActiveRecord standards and returns any error messages if it is not.
|
||||
# Ensures that the passed record is valid by Active Record standards and
|
||||
# returns any error messages if it is not.
|
||||
#
|
||||
# ==== Examples
|
||||
#
|
||||
|
|
|
@ -59,7 +59,7 @@ module ActionController
|
|||
end
|
||||
end
|
||||
|
||||
# Asserts that the provided options can be used to generate the provided path. This is the inverse of #assert_recognizes.
|
||||
# Asserts that the provided options can be used to generate the provided path. This is the inverse of +assert_recognizes+.
|
||||
# The +extras+ parameter is used to tell the request the names and values of additional request parameters that would be in
|
||||
# a query string. The +message+ parameter allows you to specify a custom error message for assertion failures.
|
||||
#
|
||||
|
@ -96,8 +96,8 @@ module ActionController
|
|||
end
|
||||
|
||||
# Asserts that path and options match both ways; in other words, it verifies that <tt>path</tt> generates
|
||||
# <tt>options</tt> and then that <tt>options</tt> generates <tt>path</tt>. This essentially combines #assert_recognizes
|
||||
# and #assert_generates into one step.
|
||||
# <tt>options</tt> and then that <tt>options</tt> generates <tt>path</tt>. This essentially combines +assert_recognizes+
|
||||
# and +assert_generates+ into one step.
|
||||
#
|
||||
# The +extras+ hash allows you to specify options that would normally be provided as a query string to the action. The
|
||||
# +message+ parameter allows you to specify a custom error message to display upon failure.
|
||||
|
|
|
@ -12,12 +12,12 @@ module ActionController
|
|||
NO_STRIP = %w{pre script style textarea}
|
||||
end
|
||||
|
||||
# Adds the #assert_select method for use in Rails functional
|
||||
# Adds the +assert_select+ method for use in Rails functional
|
||||
# test cases, which can be used to make assertions on the response HTML of a controller
|
||||
# action. You can also call #assert_select within another #assert_select to
|
||||
# action. You can also call +assert_select+ within another +assert_select+ to
|
||||
# make assertions on elements selected by the enclosing assertion.
|
||||
#
|
||||
# Use #css_select to select elements without making an assertions, either
|
||||
# Use +css_select+ to select elements without making an assertions, either
|
||||
# from the response HTML or elements selected by the enclosing assertion.
|
||||
#
|
||||
# In addition to HTML responses, you can make the following assertions:
|
||||
|
@ -44,8 +44,8 @@ module ActionController
|
|||
# base element and any of its children. Returns an empty array if no
|
||||
# match is found.
|
||||
#
|
||||
# The selector may be a CSS selector expression (+String+), an expression
|
||||
# with substitution values (+Array+) or an HTML::Selector object.
|
||||
# The selector may be a CSS selector expression (String), an expression
|
||||
# with substitution values (Array) or an HTML::Selector object.
|
||||
#
|
||||
# ==== Examples
|
||||
# # Selects all div tags
|
||||
|
@ -114,8 +114,8 @@ module ActionController
|
|||
# starting from (and including) that element and all its children in
|
||||
# depth-first order.
|
||||
#
|
||||
# If no element if specified, calling #assert_select will select from the
|
||||
# response HTML. Calling #assert_select inside an #assert_select block will
|
||||
# If no element if specified, calling +assert_select+ will select from the
|
||||
# response HTML. Calling #assert_select inside an +assert_select+ block will
|
||||
# run the assertion for each element selected by the enclosing assertion.
|
||||
#
|
||||
# ==== Example
|
||||
|
@ -130,7 +130,7 @@ module ActionController
|
|||
# assert_select "li"
|
||||
# end
|
||||
#
|
||||
# The selector may be a CSS selector expression (+String+), an expression
|
||||
# The selector may be a CSS selector expression (String), an expression
|
||||
# with substitution values, or an HTML::Selector object.
|
||||
#
|
||||
# === Equality Tests
|
||||
|
@ -356,16 +356,16 @@ module ActionController
|
|||
#
|
||||
# === Using blocks
|
||||
#
|
||||
# Without a block, #assert_select_rjs merely asserts that the response
|
||||
# Without a block, +assert_select_rjs+ merely asserts that the response
|
||||
# contains one or more RJS statements that replace or update content.
|
||||
#
|
||||
# With a block, #assert_select_rjs also selects all elements used in
|
||||
# With a block, +assert_select_rjs+ also selects all elements used in
|
||||
# these statements and passes them to the block. Nested assertions are
|
||||
# supported.
|
||||
#
|
||||
# Calling #assert_select_rjs with no arguments and using nested asserts
|
||||
# Calling +assert_select_rjs+ with no arguments and using nested asserts
|
||||
# asserts that the HTML content is returned by one or more RJS statements.
|
||||
# Using #assert_select directly makes the same assertion on the content,
|
||||
# Using +assert_select+ directly makes the same assertion on the content,
|
||||
# but without distinguishing whether the content is returned in an HTML
|
||||
# or JavaScript.
|
||||
#
|
||||
|
@ -601,7 +601,7 @@ module ActionController
|
|||
RJS_PATTERN_UNICODE_ESCAPED_CHAR = /\\u([0-9a-zA-Z]{4})/
|
||||
end
|
||||
|
||||
# #assert_select and #css_select call this to obtain the content in the HTML
|
||||
# +assert_select+ and +css_select+ call this to obtain the content in the HTML
|
||||
# page, or from all the RJS statements, depending on the type of response.
|
||||
def response_from_page_or_rjs()
|
||||
content_type = @response.content_type
|
||||
|
|
|
@ -91,7 +91,7 @@ module ActionController
|
|||
# :descendant => { :tag => "span",
|
||||
# :child => /hello world/ }
|
||||
#
|
||||
# <b>Please note</b>: #assert_tag and #assert_no_tag only work
|
||||
# <b>Please note</b>: +assert_tag+ and +assert_no_tag+ only work
|
||||
# with well-formed XHTML. They recognize a few tags as implicitly self-closing
|
||||
# (like br and hr and such) but will not work correctly with tags
|
||||
# that allow optional closing tags (p, li, td). <em>You must explicitly
|
||||
|
@ -104,8 +104,8 @@ module ActionController
|
|||
end
|
||||
end
|
||||
|
||||
# Identical to #assert_tag, but asserts that a matching tag does _not_
|
||||
# exist. (See #assert_tag for a full discussion of the syntax.)
|
||||
# Identical to +assert_tag+, but asserts that a matching tag does _not_
|
||||
# exist. (See +assert_tag+ for a full discussion of the syntax.)
|
||||
#
|
||||
# === Examples
|
||||
# # Assert that there is not a "div" containing a "p"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue