mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
commit
07f187b7fe
1 changed files with 7 additions and 4 deletions
|
@ -230,10 +230,13 @@ class OptimisticLockingTest < ActiveRecord::TestCase
|
||||||
|
|
||||||
def test_polymorphic_destroy_with_dependencies_and_lock_version
|
def test_polymorphic_destroy_with_dependencies_and_lock_version
|
||||||
car = Car.create!
|
car = Car.create!
|
||||||
|
|
||||||
|
assert_difference 'car.wheels.count' do
|
||||||
car.wheels << Wheel.create!
|
car.wheels << Wheel.create!
|
||||||
assert_equal 1, car.wheels.count
|
end
|
||||||
assert car.destroy
|
assert_difference 'car.wheels.count', -1 do
|
||||||
assert_equal 0, car.wheels.count
|
car.destroy
|
||||||
|
end
|
||||||
assert car.destroyed?
|
assert car.destroyed?
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue