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/acceptance
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
..
activesupport_instrumentation_spec.rb Deprecate and move to Internal factories methods 2019-06-04 19:39:04 -04:00
aliases_spec.rb Autocorrect all static attributes to dynamic 2018-09-14 19:27:13 +00:00
associations_spec.rb Improve documentation for collection associations (#1420) 2020-07-09 12:26:23 -04:00
attribute_aliases_spec.rb Rubocop: Fix Style/StringLiterals Offenses (#1216) 2018-10-07 21:45:51 -04:00
attribute_existing_on_object_spec.rb Run standardrb 2020-06-10 17:11:39 -04:00
attributes_for_spec.rb Run standardrb 2020-06-10 17:11:39 -04:00
attributes_from_instance_spec.rb Rubocop: Fix Style/StringLiterals Offenses (#1216) 2018-10-07 21:45:51 -04:00
attributes_ordered_spec.rb Run standardrb 2020-06-10 17:11:39 -04:00
build_list_spec.rb Pass index to block for *_list methods 2020-04-24 11:36:17 -04:00
build_spec.rb Run standardrb 2020-06-10 17:11:39 -04:00
build_stubbed_spec.rb Run standardrb 2020-06-10 17:11:39 -04:00
callbacks_spec.rb Run standardrb 2020-06-10 17:11:39 -04:00
create_list_spec.rb Pass index to block for *_list methods 2020-04-24 11:36:17 -04:00
create_pair_spec.rb Rubocop: Fix Style/StringLiterals Offenses (#1216) 2018-10-07 21:45:51 -04:00
create_spec.rb Run standardrb 2020-06-10 17:11:39 -04:00
define_child_before_parent_spec.rb Autocorrect all static attributes to dynamic 2018-09-14 19:27:13 +00:00
defining_methods_inside_a_factory_spec.rb Run standardrb 2020-06-10 17:11:39 -04:00
definition_camel_string_spec.rb Run standardrb 2020-06-10 17:11:39 -04:00
definition_spec.rb Run standardrb 2020-06-10 17:11:39 -04:00
definition_without_block_spec.rb Run standardrb 2020-06-10 17:11:39 -04:00
enum_traits_spec.rb Run standardrb 2020-06-10 17:11:39 -04:00
global_initialize_with_spec.rb Rubocop: Fix Style/StringLiterals Offenses (#1216) 2018-10-07 21:45:51 -04:00
global_to_create_spec.rb Rubocop: Fix Style/StringLiterals Offenses (#1216) 2018-10-07 21:45:51 -04:00
initialize_with_spec.rb Fix ruby 2.7 kwargs warning 2020-06-24 18:27:38 -04:00
keyed_by_class_spec.rb Run standardrb 2020-06-10 17:11:39 -04:00
lint_spec.rb Run standardrb 2020-06-10 17:11:39 -04:00
modify_factories_spec.rb Run standardrb 2020-06-10 17:11:39 -04:00
modify_inherited_spec.rb Run standardrb 2020-06-10 17:11:39 -04:00
nested_attributes_spec.rb Remove remaining RuboCop TODOs 2018-10-21 12:15:32 -04:00
overrides_spec.rb Run standardrb 2020-06-10 17:11:39 -04:00
parent_spec.rb Run standardrb 2020-06-10 17:11:39 -04:00
private_attributes_spec.rb Run standardrb 2020-06-10 17:11:39 -04:00
register_strategies_spec.rb Adjust use_parent_strategy safely in specs 2019-08-12 18:54:53 +01:00
reload_spec.rb Adjust use_parent_strategy safely in specs 2019-08-12 18:54:53 +01:00
sequence_context_spec.rb Rubocop: Fix Style/StringLiterals Offenses (#1216) 2018-10-07 21:45:51 -04:00
sequence_resetting_spec.rb Allow inline sequences in traits to have same name 2019-02-15 17:10:27 -05:00
sequence_spec.rb Run standardrb 2020-06-10 17:11:39 -04:00
skip_create_spec.rb Autocorrect all static attributes to dynamic 2018-09-14 19:27:13 +00:00
stub_spec.rb Avoid stubbing id for records without primary key 2019-07-19 15:18:11 -04:00
syntax_methods_within_dynamic_attributes_spec.rb Rubocop: Fix Style/StringLiterals Offenses (#1216) 2018-10-07 21:45:51 -04:00
traits_spec.rb Run standardrb 2020-06-10 17:11:39 -04:00
transient_attributes_spec.rb Run standardrb 2020-06-10 17:11:39 -04:00