@@ -71,19 +71,19 @@ def assert_nothing_raised
71
71
# post :delete, params: { id: ... }
72
72
# end
73
73
#
74
- # An array of expressions can also be passed in and evaluated.
74
+ # An array of expressions can be passed in and evaluated.
75
75
#
76
76
# assert_difference [ 'Article.count', 'Post.count' ], 2 do
77
77
# post :create, params: { article: {...} }
78
78
# end
79
79
#
80
- # A hash of expressions/numeric differences can also be passed in and evaluated.
80
+ # A hash of expressions/numeric differences can be passed in and evaluated.
81
81
#
82
- # assert_difference ->{ Article.count } => 1, ->{ Notification.count } => 2 do
82
+ # assert_difference({ ' Article.count' => 1, ' Notification.count' => 2 }) do
83
83
# post :create, params: { article: {...} }
84
84
# end
85
85
#
86
- # A lambda or a list of lambdas can be passed in and evaluated:
86
+ # A lambda, a list of lambdas or a hash of lambdas/numeric differences can be passed in and evaluated:
87
87
#
88
88
# assert_difference ->{ Article.count }, 2 do
89
89
# post :create, params: { article: {...} }
@@ -93,6 +93,10 @@ def assert_nothing_raised
93
93
# post :create, params: { article: {...} }
94
94
# end
95
95
#
96
+ # assert_difference ->{ Article.count } => 1, ->{ Notification.count } => 2 do
97
+ # post :create, params: { article: {...} }
98
+ # end
99
+ #
96
100
# An error message can be specified.
97
101
#
98
102
# assert_difference 'Article.count', -1, 'An Article should be destroyed' do
0 commit comments