You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|[`assert_difference(expressions, difference = 1, message = nil) {...}`](https://api.rubyonrails.org/classes/ActiveSupport/Testing/Assertions.html#method-i-assert_difference)| Test numeric difference between the return value of an expression as a result of what is evaluated in the yielded block.|
357
-
|[`assert_no_difference(expressions, message = nil, &block)`](https://api.rubyonrails.org/classes/ActiveSupport/Testing/Assertions.html#method-i-assert_no_difference)| Asserts that the numeric result of evaluating an expression is not changed before and after invoking the passed in block.|
358
-
|[`assert_changes(expressions, message = nil, from:, to:, &block)`](https://api.rubyonrails.org/classes/ActiveSupport/Testing/Assertions.html#method-i-assert_changes)| Test that the result of evaluating an expression is changed after invoking the passed in block.|
359
-
|[`assert_no_changes(expressions, message = nil, &block)`](https://api.rubyonrails.org/classes/ActiveSupport/Testing/Assertions.html#method-i-assert_no_changes)| Test the result of evaluating an expression is not changed after invoking the passed in block.|
360
-
|[`assert_nothing_raised { block }`](https://api.rubyonrails.org/classes/ActiveSupport/Testing/Assertions.html#method-i-assert_nothing_raised)| Ensures that the given block doesn't raise any exceptions.|
361
-
|[`assert_recognizes(expected_options, path, extras={}, message=nil)`](https://api.rubyonrails.org/classes/ActionDispatch/Assertions/RoutingAssertions.html#method-i-assert_recognizes)| 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.|
362
-
|[`assert_generates(expected_path, options, defaults={}, extras = {}, message=nil)`](https://api.rubyonrails.org/classes/ActionDispatch/Assertions/RoutingAssertions.html#method-i-assert_generates)| 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.|
363
-
|[`assert_response(type, message = nil)`](https://api.rubyonrails.org/classes/ActionDispatch/Assertions/ResponseAssertions.html#method-i-assert_response)| 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](https://rubydoc.info/gems/rack/Rack/Utils#HTTP_STATUS_CODES-constant) and how their [mapping](https://rubydoc.info/gems/rack/Rack/Utils#SYMBOL_TO_STATUS_CODE-constant) works.|
364
-
|[`assert_redirected_to(options = {}, message=nil)`](https://api.rubyonrails.org/classes/ActionDispatch/Assertions/ResponseAssertions.html#method-i-assert_redirected_to)| Asserts that the response is a redirect to a URL matching the given options. You can also pass named routes such as `assert_redirected_to root_path` and Active Record objects such as `assert_redirected_to @article`.|
365
-
|`assert_queries_count(int, &block)`| Asserts that `&block` generates an `int` number of SQL queries.|
366
-
|`assert_no_queries(&block)`| Asserts that `&block` generates no SQL queries.|
367
-
|`assert_queries_match(pattern, &block)`| Asserts that `&block` generates SQL queries that match the pattern.|
368
-
|`assert_no_queries_match(pattern, &block)`| Asserts that `&block` generates no SQL queries that match the pattern.|
356
+
|[`assert_difference(expressions, difference = 1, message = nil) {...}`][]| Test numeric difference between the return value of an expression as a result of what is evaluated in the yielded block.|
357
+
|[`assert_no_difference(expressions, message = nil, &block)`][]| Asserts that the numeric result of evaluating an expression is not changed before and after invoking the passed in block.|
358
+
|[`assert_changes(expressions, message = nil, from:, to:, &block)`][]| Test that the result of evaluating an expression is changed after invoking the passed in block.|
359
+
|[`assert_no_changes(expressions, message = nil, &block)`][]| Test the result of evaluating an expression is not changed after invoking the passed in block.|
360
+
|[`assert_nothing_raised { block }`][]| Ensures that the given block doesn't raise any exceptions.|
361
+
|[`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.|
362
+
|[`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.|
363
+
|[`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](https://rubydoc.info/gems/rack/Rack/Utils#HTTP_STATUS_CODES-constant) and how their [mapping](https://rubydoc.info/gems/rack/Rack/Utils#SYMBOL_TO_STATUS_CODE-constant) works.|
364
+
|[`assert_redirected_to(options = {}, message=nil)`][]| Asserts that the response is a redirect to a URL matching the given options. You can also pass named routes such as `assert_redirected_to root_path` and Active Record objects such as `assert_redirected_to @article`.|
365
+
|[`assert_queries_count(count = nil, include_schema: false, &block)`][]| Asserts that `&block` generates an `int` number of SQL queries.|
366
+
|[`assert_no_queries(include_schema: false, &block)`][]| Asserts that `&block` generates no SQL queries.|
367
+
|[`assert_queries_match(pattern, count: nil, include_schema: false, &block)`][]| Asserts that `&block` generates SQL queries that match the pattern.|
368
+
|[`assert_no_queries_match(pattern, &block)`][]| Asserts that `&block` generates no SQL queries that match the pattern.|
0 commit comments