Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

18 lines (14 sloc) 0.806 kb
assert_no_difference: |-
assert_no_difference -- an assertion for your testing suite
assert_no_difference 'Model.count' do
puts "blah"
Synonym for:
assert_difference 'Model.count', 0 do
puts "blah" #or any action that will NOT change the argument.
This is useful for when you are testing benign actions or, even better, when you have fail-safes that allow an action to be executed but do not actually affect the database.
For instance, you've got an action that is protected by authentication and you don't want to broadcast its existance to anyone with lesser permissions. If an unauthenticated
use navigates to the action, just let them see nothing (render :nothing => true or something to that effect) and chug along without caring.
Jump to Line
Something went wrong with that request. Please try again.