Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

refactored tests -- assert_diffrence instead of checking directly with c... #4294

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants
Contributor

Karunakar commented Jan 4, 2012

...ount

@Karunakar Karunakar closed this Jan 4, 2012

Contributor

Karunakar commented Jan 4, 2012

Duplicated one

@tenderlove tenderlove commented on the diff Jan 4, 2012

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', +1 do
@tenderlove

tenderlove Jan 4, 2012

Owner

The default difference is 1, so please remove the +1 from this code.

@Karunakar

Karunakar Jan 4, 2012

Contributor

Thanks for pointing out. I have remove that and send the commit .

This pull request is duplicate for this #4301. I have closed it already.

Please consider #4301. I have done the changes as per your comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment