1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #4301 from Karunakar/refactor_tests

Refactor tests
This commit is contained in:
Aaron Patterson 2012-01-05 09:24:47 -08:00
commit 07f187b7fe

View file

@ -230,10 +230,13 @@ class OptimisticLockingTest < ActiveRecord::TestCase
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