aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYves Senn <yves.senn@gmail.com>2014-02-07 18:42:51 +0100
committerYves Senn <yves.senn@gmail.com>2014-02-07 18:42:51 +0100
commited66361488752aa115f8d95175cde6dd24f3496d (patch)
tree94ecd362e16e72f85d26fd6480c5f8cd61292416
parent9da2ae11cb8782869ecc0422803b090268e223ee (diff)
parent8fffcfc674bc15fed1a20934962fa35b5c907549 (diff)
downloadrails-ed66361488752aa115f8d95175cde6dd24f3496d.tar.gz
rails-ed66361488752aa115f8d95175cde6dd24f3496d.tar.bz2
rails-ed66361488752aa115f8d95175cde6dd24f3496d.zip
Merge pull request #13952 from prathamesh-sonpatki/testing
[Testing Guide] Mention :unauthorized in assert_response explanation [ci skip]
-rw-r--r--guides/source/testing.md2
1 files changed, 1 insertions, 1 deletions
diff --git a/guides/source/testing.md b/guides/source/testing.md
index 408c072575..34573d2b0a 100644
--- a/guides/source/testing.md
+++ b/guides/source/testing.md
@@ -401,7 +401,7 @@ Rails adds some custom assertions of its own to the `test/unit` framework:
| `assert_no_difference(expressions, message = nil, &amp;block)` | Asserts that the numeric result of evaluating an expression is not changed before and after invoking the passed in block.|
| `assert_recognizes(expected_options, path, extras={}, message=nil)` | 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.|
| `assert_generates(expected_path, options, defaults={}, extras = {}, message=nil)` | 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.|
-| `assert_response(type, message = nil)` | Asserts that the response comes with a specific status code. You can specify `:success` to indicate 200-299, `:redirect` to indicate 300-399, `:missing` to indicate 404, or `:error` to match the 500-599 range|
+| `assert_response(type, message = nil)` | Asserts that the response comes with a specific status code. You can specify `:success` to indicate 200-299, `:redirect` to indicate 300-399, `:missing` to indicate 404, or `:error` to match the 500-599 range. You can also pass an explicit status number or its symbolic equivalent. For more information, see [full list of status codes](http://rubydoc.info/github/rack/rack/master/Rack/Utils#HTTP_STATUS_CODES-constant) and how their [mapping](http://rubydoc.info/github/rack/rack/master/Rack/Utils#SYMBOL_TO_STATUS_CODE-constant) works.|
| `assert_redirected_to(options = {}, message=nil)` | 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.|
| `assert_template(expected = nil, message=nil)` | Asserts that the request was rendered with the appropriate template file.|