Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Refactor tests #4301

Merged
merged 2 commits into from

2 participants

@Karunakar

Missed it. Thanks for pointing it out. will keep in mind for next commits

@tenderlove tenderlove merged commit 07f187b into rails:master
@tenderlove tenderlove merged commit ca0718c into rails:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
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
Something went wrong with that request. Please try again.