From 60de0e56b7f57f0052d7e4f43bd2ef9e363c6a1a Mon Sep 17 00:00:00 2001 From: Joost Baaij Date: Fri, 27 Aug 2010 22:20:53 +0200 Subject: call-seq directive makes rdoc cry and replaces method names with a curly brace; besides it doesn't add anything when you only list one call example since this is obviously documented already --- .../action_dispatch/testing/assertions/selector.rb | 37 ++++++---------------- 1 file changed, 9 insertions(+), 28 deletions(-) (limited to 'actionpack/lib/action_dispatch/testing/assertions') diff --git a/actionpack/lib/action_dispatch/testing/assertions/selector.rb b/actionpack/lib/action_dispatch/testing/assertions/selector.rb index 2fc9e2b7d6..21985369cc 100644 --- a/actionpack/lib/action_dispatch/testing/assertions/selector.rb +++ b/actionpack/lib/action_dispatch/testing/assertions/selector.rb @@ -9,7 +9,7 @@ module ActionDispatch module Assertions NO_STRIP = %w{pre script style textarea} - # 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 # make assertions on elements selected by the enclosing assertion. @@ -18,16 +18,12 @@ module ActionDispatch # from the response HTML or elements selected by the enclosing assertion. # # In addition to HTML responses, you can make the following assertions: - # * +assert_select_rjs+ - Assertions on HTML content of RJS update and insertion operations. - # * +assert_select_encoded+ - Assertions on HTML encoded inside XML, for example for dealing with feed item descriptions. - # * +assert_select_email+ - Assertions on the HTML body of an e-mail. + # * +assert_select_rjs+ - \Assertions on HTML content of RJS update and insertion operations. + # * +assert_select_encoded+ - \Assertions on HTML encoded inside XML, for example for dealing with feed item descriptions. + # * +assert_select_email+ - \Assertions on the HTML body of an e-mail. # # Also see HTML::Selector to learn how to use selectors. module SelectorAssertions - # :call-seq: - # css_select(selector) => array - # css_select(element, selector) => array - # # Select and return all matching elements. # # If called with a single argument, uses that argument as a selector @@ -39,7 +35,7 @@ module ActionDispatch # 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 + # The selector may be a CSS selector expression (string), an expression # with substitution values (Array) or an HTML::Selector object. # # ==== Examples @@ -99,10 +95,6 @@ module ActionDispatch selector.select(root) end - # :call-seq: - # assert_select(selector, equality?, message?) - # assert_select(element, selector, equality?, message?) - # # An assertion that selects elements and makes one or more equality tests. # # If the first argument is an element, selects all matching elements @@ -132,7 +124,7 @@ module ActionDispatch # assert_select "li", 8 # 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 @@ -140,11 +132,11 @@ module ActionDispatch # The equality test may be one of the following: # * true - Assertion is true if at least one element selected. # * false - Assertion is true if no element selected. - # * String/Regexp - Assertion is true if the text value of at least + # * string/Regexp - Assertion is true if the text value of at least # one element matches the string or regular expression. - # * Integer - Assertion is true if exactly that number of + # * integer - Assertion is true if exactly that number of # elements are selected. - # * Range - Assertion is true if the number of selected + # * range - Assertion is true if the number of selected # elements fit the range. # If no equality test specified, the assertion is true if at least one # element selected. @@ -332,11 +324,6 @@ module ActionDispatch end end - # :call-seq: - # assert_select_rjs(id?) { |elements| ... } - # assert_select_rjs(statement, id?) { |elements| ... } - # assert_select_rjs(:insert, position, id?) { |elements| ... } - # # Selects content from the RJS response. # # === Narrowing down @@ -474,9 +461,6 @@ module ActionDispatch end end - # :call-seq: - # assert_select_encoded(element?) { |elements| ... } - # # Extracts the content of an element, treats it as encoded HTML and runs # nested assertion on it. # @@ -543,9 +527,6 @@ module ActionDispatch end end - # :call-seq: - # assert_select_email { } - # # Extracts the body of an email and runs nested assertions on it. # # You must enable deliveries for this assertion to work, use: -- cgit v1.2.3 From 4a56f8f3145e396c9932be83d563fd75219c1f4d Mon Sep 17 00:00:00 2001 From: Joost Baaij Date: Fri, 27 Aug 2010 22:47:11 +0200 Subject: escape constants that should not be linked to --- actionpack/lib/action_dispatch/testing/assertions/dom.rb | 2 +- actionpack/lib/action_dispatch/testing/assertions/response.rb | 10 +++++----- actionpack/lib/action_dispatch/testing/assertions/routing.rb | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'actionpack/lib/action_dispatch/testing/assertions') diff --git a/actionpack/lib/action_dispatch/testing/assertions/dom.rb b/actionpack/lib/action_dispatch/testing/assertions/dom.rb index 9c215de743..47c84742aa 100644 --- a/actionpack/lib/action_dispatch/testing/assertions/dom.rb +++ b/actionpack/lib/action_dispatch/testing/assertions/dom.rb @@ -3,7 +3,7 @@ require 'action_controller/vendor/html-scanner' module ActionDispatch module Assertions module DomAssertions - # Test two HTML strings for equivalency (e.g., identical up to reordering of attributes) + # \Test two HTML strings for equivalency (e.g., identical up to reordering of attributes) # # ==== Examples # diff --git a/actionpack/lib/action_dispatch/testing/assertions/response.rb b/actionpack/lib/action_dispatch/testing/assertions/response.rb index ec5e9efe44..10b122557a 100644 --- a/actionpack/lib/action_dispatch/testing/assertions/response.rb +++ b/actionpack/lib/action_dispatch/testing/assertions/response.rb @@ -1,6 +1,6 @@ module ActionDispatch module Assertions - # A small suite of assertions that test responses from Rails applications. + # A small suite of assertions that test responses from \Rails applications. module ResponseAssertions extend ActiveSupport::Concern @@ -18,8 +18,8 @@ module ActionDispatch # * :missing - Status code was 404 # * :error - Status code was in the 500-599 range # - # You can also pass an explicit status number like assert_response(501) - # or its symbolic equivalent assert_response(:not_implemented). + # You can also pass an explicit status number like assert_response(501) + # or its symbolic equivalent assert_response(:not_implemented). # See ActionDispatch::StatusCodes for a full list. # # ==== Examples @@ -45,8 +45,8 @@ module ActionDispatch end # Assert that the redirection options passed in match those of the redirect called in the latest action. - # This match can be partial, such that assert_redirected_to(:controller => "weblog") will also - # match the redirection of redirect_to(:controller => "weblog", :action => "show") and so on. + # This match can be partial, such that assert_redirected_to(:controller => "weblog") will also + # match the redirection of redirect_to(:controller => "weblog", :action => "show") and so on. # # ==== Examples # diff --git a/actionpack/lib/action_dispatch/testing/assertions/routing.rb b/actionpack/lib/action_dispatch/testing/assertions/routing.rb index 5a3ffda255..c5fed1fc8f 100644 --- a/actionpack/lib/action_dispatch/testing/assertions/routing.rb +++ b/actionpack/lib/action_dispatch/testing/assertions/routing.rb @@ -4,10 +4,10 @@ require 'active_support/core_ext/hash/indifferent_access' module ActionDispatch module Assertions - # Suite of assertions to test routes generated by Rails and the handling of requests made to them. + # Suite of assertions to test routes generated by \Rails and the handling of requests made to them. module RoutingAssertions # Asserts that the routing of the given +path+ was handled correctly and that the parsed options (given in the +expected_options+ hash) - # match +path+. Basically, it asserts that Rails recognizes the route given by +expected_options+. + # match +path+. Basically, it asserts that \Rails recognizes the route given by +expected_options+. # # Pass a hash in the second argument (+path+) to specify the request method. This is useful for routes # requiring a specific HTTP method. The hash should contain a :path with the incoming request path -- cgit v1.2.3 From 27d42a56b9b28ab9966fa73971e1a5b7a9c8cdff Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Fri, 27 Aug 2010 23:30:52 +0200 Subject: Revert "call-seq directive makes rdoc cry and replaces method names with a curly brace; besides it doesn't add anything when you only list one call example since this is obviously documented already" Reason: Part of this commit touches vendorized stuff, the rest is fine, could you please repatch? This reverts commit 60de0e56b7f57f0052d7e4f43bd2ef9e363c6a1a. --- .../action_dispatch/testing/assertions/selector.rb | 37 ++++++++++++++++------ 1 file changed, 28 insertions(+), 9 deletions(-) (limited to 'actionpack/lib/action_dispatch/testing/assertions') diff --git a/actionpack/lib/action_dispatch/testing/assertions/selector.rb b/actionpack/lib/action_dispatch/testing/assertions/selector.rb index 21985369cc..2fc9e2b7d6 100644 --- a/actionpack/lib/action_dispatch/testing/assertions/selector.rb +++ b/actionpack/lib/action_dispatch/testing/assertions/selector.rb @@ -9,7 +9,7 @@ module ActionDispatch module Assertions NO_STRIP = %w{pre script style textarea} - # 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 # make assertions on elements selected by the enclosing assertion. @@ -18,12 +18,16 @@ module ActionDispatch # from the response HTML or elements selected by the enclosing assertion. # # In addition to HTML responses, you can make the following assertions: - # * +assert_select_rjs+ - \Assertions on HTML content of RJS update and insertion operations. - # * +assert_select_encoded+ - \Assertions on HTML encoded inside XML, for example for dealing with feed item descriptions. - # * +assert_select_email+ - \Assertions on the HTML body of an e-mail. + # * +assert_select_rjs+ - Assertions on HTML content of RJS update and insertion operations. + # * +assert_select_encoded+ - Assertions on HTML encoded inside XML, for example for dealing with feed item descriptions. + # * +assert_select_email+ - Assertions on the HTML body of an e-mail. # # Also see HTML::Selector to learn how to use selectors. module SelectorAssertions + # :call-seq: + # css_select(selector) => array + # css_select(element, selector) => array + # # Select and return all matching elements. # # If called with a single argument, uses that argument as a selector @@ -35,7 +39,7 @@ module ActionDispatch # 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 + # The selector may be a CSS selector expression (String), an expression # with substitution values (Array) or an HTML::Selector object. # # ==== Examples @@ -95,6 +99,10 @@ module ActionDispatch selector.select(root) end + # :call-seq: + # assert_select(selector, equality?, message?) + # assert_select(element, selector, equality?, message?) + # # An assertion that selects elements and makes one or more equality tests. # # If the first argument is an element, selects all matching elements @@ -124,7 +132,7 @@ module ActionDispatch # assert_select "li", 8 # 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 @@ -132,11 +140,11 @@ module ActionDispatch # The equality test may be one of the following: # * true - Assertion is true if at least one element selected. # * false - Assertion is true if no element selected. - # * string/Regexp - Assertion is true if the text value of at least + # * String/Regexp - Assertion is true if the text value of at least # one element matches the string or regular expression. - # * integer - Assertion is true if exactly that number of + # * Integer - Assertion is true if exactly that number of # elements are selected. - # * range - Assertion is true if the number of selected + # * Range - Assertion is true if the number of selected # elements fit the range. # If no equality test specified, the assertion is true if at least one # element selected. @@ -324,6 +332,11 @@ module ActionDispatch end end + # :call-seq: + # assert_select_rjs(id?) { |elements| ... } + # assert_select_rjs(statement, id?) { |elements| ... } + # assert_select_rjs(:insert, position, id?) { |elements| ... } + # # Selects content from the RJS response. # # === Narrowing down @@ -461,6 +474,9 @@ module ActionDispatch end end + # :call-seq: + # assert_select_encoded(element?) { |elements| ... } + # # Extracts the content of an element, treats it as encoded HTML and runs # nested assertion on it. # @@ -527,6 +543,9 @@ module ActionDispatch end end + # :call-seq: + # assert_select_email { } + # # Extracts the body of an email and runs nested assertions on it. # # You must enable deliveries for this assertion to work, use: -- cgit v1.2.3