Problem
Trying to use the assert_difference with Rails 2.1.0 produces errors if trying to use it with the syntax of another rails version.
Solution
The correct syntax for using assert_difference with rails 2.1.0 is:
1 2 3 4 5 6 7 8 9 10 11 |
def test_should_create_user assert_difference(User, :count, 1) do user = create_user assert !user.new_record?, "#{user.errors.full_messages.to_sentence}" end end |