This project is archived and is in readonly mode.

#5206 ✓resolved

nested attributes test should rely on associations to verify the results on count

Reported by Subba | July 27th, 2010 @ 04:17 AM

currently nested attributes tests relying on assert_difference, assert_no_difference to verify results.

 assert_difference('Ship.count', 1) do
   @pirate.reload.update_attributes(:update_only_ship_attributes => { :name => 'Mayflower' })

as opposed to testing the actual relations.

 @pirate.reload.update_attributes(:update_only_ship_attributes => { :name => 'Mayflower' })

 assert_not_nil @pirate.reload.ship
 assert_equal @ship, @pirate.reload.ship

this patch fixes nested attributes tests.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href=""></a>


Referenced by