Skip to content
Browse files

Merge pull request #4301 from Karunakar/refactor_tests

Refactor tests
  • Loading branch information...
2 parents f4ef09c + ca0718c commit 07f187b7fe468ff7566f8365eb73339087b03c89 @tenderlove tenderlove committed Jan 5, 2012
Showing with 7 additions and 4 deletions.
  1. +7 −4 activerecord/test/cases/locking_test.rb
View
11 activerecord/test/cases/locking_test.rb
@@ -230,10 +230,13 @@ def test_update_without_attributes_does_not_only_update_lock_version
def test_polymorphic_destroy_with_dependencies_and_lock_version
car = Car.create!
- car.wheels << Wheel.create!
- assert_equal 1, car.wheels.count
- assert car.destroy
- assert_equal 0, car.wheels.count
+
+ assert_difference 'car.wheels.count' do
+ car.wheels << Wheel.create!
+ end
+ assert_difference 'car.wheels.count', -1 do
+ car.destroy
+ end
assert car.destroyed?
end
end

0 comments on commit 07f187b

Please sign in to comment.
Something went wrong with that request. Please try again.