aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/nested_attributes_with_callbacks_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Use assert_not rather than refutePiotr Sarnacki2013-08-121-5/+5
|
* Refactor NestedAttributesWithCallbacksTest for clarityBen Woosley2013-08-121-67/+66
| | | | | | | 1) Use `assert` and `refute` where possible. 2) Separately include the setup, subject, and assertions in each test - don't hide the tested call in an assertion method. 3) Name things based on their role rather than incidental facts about them - e.g. `@bird[1]` -> `bird_to_destroy`. `bird2_deletion_attributes` -> `destroy_bird_attributes`. 4) Use more succinct naming where possible - e.g. `birds_with_callback` -> `birds_with_add`, `@pirate_with_two_birds` -> `@pirate`
* Fix interactions between :before_add callbacks and nested attributes assignmentDr.(USA) Joerg Schray2013-08-121-0/+145
Issue #1: :before_add callback is called when nested attributes assignment assigns to existing record if the association is not yet loaded Issue #2: Nested Attributes assignment does not affect the record in the association target when callback triggers loading of the association