assert_difference(expression, difference = 1, message = nil, &block) click to toggle source
Checks the numeric difference between the return value of an expression as a result of what is evaluated.
assert_difference "User.count", +1 do User.create end
# File lib/minitest/rails/assertions.rb, line 14
assert_no_difference(expression, message = nil, &block) click to toggle source
Checks that the numeric result of evaluating an expression is not changed before and after invoking.
assert_no_difference "User.count" do User.new end
# File lib/minitest/rails/assertions.rb, line 26
Also aliased as: refute_difference