aboutsummaryrefslogtreecommitdiffstats
path: root/guides
diff options
context:
space:
mode:
authorGenadi Samokovarov <gsamokovarov@gmail.com>2017-05-29 13:12:48 +0300
committerGenadi Samokovarov <gsamokovarov@gmail.com>2017-05-29 13:12:48 +0300
commit9bd7881c2047f59b42f325ed882068cc881cbe48 (patch)
tree3c5ada696b220f03a32863b56ef13af3c59be79f /guides
parent7a3db2ea15970e4c9c31a2b23303928aeadb391d (diff)
downloadrails-9bd7881c2047f59b42f325ed882068cc881cbe48.tar.gz
rails-9bd7881c2047f59b42f325ed882068cc881cbe48.tar.bz2
rails-9bd7881c2047f59b42f325ed882068cc881cbe48.zip
List assert_{,no_}changes in the testing guide
This lists the `assert_changes` and `assert_no_changes` methods in the guides. [ci skip]
Diffstat (limited to 'guides')
-rw-r--r--guides/source/testing.md2
1 files changed, 2 insertions, 0 deletions
diff --git a/guides/source/testing.md b/guides/source/testing.md
index c0394f927e..1db48ed56c 100644
--- a/guides/source/testing.md
+++ b/guides/source/testing.md
@@ -350,6 +350,8 @@ Rails adds some custom assertions of its own to the `minitest` framework:
| --------------------------------------------------------------------------------- | ------- |
| [`assert_difference(expressions, difference = 1, message = nil) {...}`](http://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.|
| [`assert_no_difference(expressions, message = nil, &block)`](http://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.|
+| [`assert_changes(expressions, message = nil, from:, to:, &block) {...}`](http://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.|
+| [`assert_no_changes(expressions, message = nil, &block)`](http://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.|
| [`assert_nothing_raised { block }`](http://api.rubyonrails.org/classes/ActiveSupport/Testing/Assertions.html#method-i-assert_nothing_raised) | Ensures that the given block doesn't raise any exceptions.|
| [`assert_recognizes(expected_options, path, extras={}, message=nil)`](http://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.|
| [`assert_generates(expected_path, options, defaults={}, extras = {}, message=nil)`](http://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.|