Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

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

#5206

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' })
 end

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.

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

State: resolved
Milestone: none
Assigned to: José Valim José Valim
Importance: Low

Activity

  1. Subba
  2. Subba
    Subba
    • Assigned user set to José Valim

    July 27th, 2010 @ 04:22 AM

  3. Santiago Pastorino
    Santiago Pastorino
    • Importance changed from to Low

    Subba can you upload it again, i'm getting errors trying to GET your file

    July 27th, 2010 @ 05:02 AM

  4. Neeraj Singh
    Neeraj Singh

    same here. not able to see the uploaded patch.

    July 27th, 2010 @ 05:04 AM

  5. Subba
    Subba

    okay i am attaching patch again.

    July 27th, 2010 @ 12:37 PM

  6. Repository
    Repository
    • State changed from new to resolved

    (from [9c5248f6f2a1e8c417a7afd25c818181e7ff5564]) nested attributes tests should rely on associated objects to verify results not on assert_difference [#5206 nested attributes test should rely on associations to verify the results on c... state:resolved]

    Signed-off-by: José Valim jose.valim@gmail.com
    http://github.com/rails/rails/commit/9c5248f6f2a1e8c417a7afd25c8181...

    September 1st, 2010 @ 09:15 AM

  7. Repository