1
0
Fork 0
mirror of https://github.com/thoughtbot/factory_bot.git synced 2022-11-09 11:43:51 -05:00
thoughtbot--factory_bot/spec
Daniel Colson 9879060289
Improve documentation for collection associations (#1420)
* Improve documentation for collection associations

This commit makes `Evaluator#association` and `Evaluator#instance`
officially part of the public API of factory\_bot. Folks were already
using these methods, and all of the examples here were inspired by
examples in the various issues mentioned below.

This commit also adds and updates some tests to match the examples in
the documentation, to ensure that these examples will continue to work
as expected.

Closes #1268 by adding documentation for both `Evaluator#association`
and `Evaluator#instance`. The documentation on interconnected
associations is also relevant to #1063, #1255, and #1309.

Closes #1304 by providing multiple alternative approaches to creating
collection associations, and adding a note about reloading the record in
the callback example. This had also come up back in #549.

Closes #458 by offering `Evaluator#association` as a more flexible way
to build collection associations. This has come up many times over the
years in many different forms, including #426, #487, #640, #1022, #1150,
and #1360.
2020-07-09 12:26:23 -04:00
..
acceptance Improve documentation for collection associations (#1420) 2020-07-09 12:26:23 -04:00
factory_bot Run standardrb 2020-06-10 17:11:39 -04:00
support Run standardrb 2020-06-10 17:11:39 -04:00
factory_bot_spec.rb Run standardrb 2020-06-10 17:11:39 -04:00
spec_helper.rb Adjust use_parent_strategy safely in specs 2019-08-12 18:54:53 +01:00