aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authoryuuji.yaginuma <yuuji.yaginuma@gmail.com>2015-05-24 08:34:15 +0900
committeryuuji.yaginuma <yuuji.yaginuma@gmail.com>2015-05-24 08:34:15 +0900
commitaa8672a5ba3af7f9b440bc58dc63ed8aa2b586c0 (patch)
treea002059e49689e4d87e3a40fbb05c43e8c955268 /activesupport
parent42e66fac38b54dd53d062fb5d3376218ed2ffdae (diff)
downloadrails-aa8672a5ba3af7f9b440bc58dc63ed8aa2b586c0.tar.gz
rails-aa8672a5ba3af7f9b440bc58dc63ed8aa2b586c0.tar.bz2
rails-aa8672a5ba3af7f9b440bc58dc63ed8aa2b586c0.zip
use keyword arguments in HTTP request methods of assert_difference example [ci skip]
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/testing/assertions.rb18
1 files changed, 9 insertions, 9 deletions
diff --git a/activesupport/lib/active_support/testing/assertions.rb b/activesupport/lib/active_support/testing/assertions.rb
index 8b649c193f..411dd29df5 100644
--- a/activesupport/lib/active_support/testing/assertions.rb
+++ b/activesupport/lib/active_support/testing/assertions.rb
@@ -23,42 +23,42 @@ module ActiveSupport
# result of what is evaluated in the yielded block.
#
# assert_difference 'Article.count' do
- # post :create, article: {...}
+ # post :create, params: { article: {...} }
# end
#
# An arbitrary expression is passed in and evaluated.
#
# assert_difference 'assigns(:article).comments(:reload).size' do
- # post :create, comment: {...}
+ # post :create, params: { comment: {...} }
# end
#
# An arbitrary positive or negative difference can be specified.
# The default is <tt>1</tt>.
#
# assert_difference 'Article.count', -1 do
- # post :delete, id: ...
+ # post :delete, params: { id: ... }
# end
#
# An array of expressions can also be passed in and evaluated.
#
# assert_difference [ 'Article.count', 'Post.count' ], 2 do
- # post :create, article: {...}
+ # post :create, params: { article: {...} }
# end
#
# A lambda or a list of lambdas can be passed in and evaluated:
#
# assert_difference ->{ Article.count }, 2 do
- # post :create, article: {...}
+ # post :create, params: { article: {...} }
# end
#
# assert_difference [->{ Article.count }, ->{ Post.count }], 2 do
- # post :create, article: {...}
+ # post :create, params: { article: {...} }
# end
#
# An error message can be specified.
#
# assert_difference 'Article.count', -1, 'An Article should be destroyed' do
- # post :delete, id: ...
+ # post :delete, params: { id: ... }
# end
def assert_difference(expression, difference = 1, message = nil, &block)
expressions = Array(expression)
@@ -81,13 +81,13 @@ module ActiveSupport
# changed before and after invoking the passed in block.
#
# assert_no_difference 'Article.count' do
- # post :create, article: invalid_attributes
+ # post :create, params: { article: invalid_attributes }
# end
#
# An error message can be specified.
#
# assert_no_difference 'Article.count', 'An Article should not be created' do
- # post :create, article: invalid_attributes
+ # post :create, params: { article: invalid_attributes }
# end
def assert_no_difference(expression, message = nil, &block)
assert_difference expression, 0, message, &block