mirror of
https://github.com/thoughtbot/factory_bot.git
synced 2022-11-09 11:43:51 -05:00
f606018a78
Closes #1391 Along the same lines as #1286, this commit raises a more helpful error if somebody passes an implicit declaration as an association argument. Before this commit, an association with an implicit trait passed as an override attribute: ```rb person factory: :user, invalid_attribute: implicit_trait ``` Would raise an error `KeyError: Trait not registered: "implicit_trait"`. This is potentially confusing, since the author probably didn't intend to define an implicit trait. After this commit, this will raise a more helpful error: ``` ArgumentError: Association 'person' received an invalid attribute override. Did you mean? 'invalid_attribute}: :implicit_trait}' ``` |
||
---|---|---|
.. | ||
activesupport_instrumentation_spec.rb | ||
aliases_spec.rb | ||
associations_spec.rb | ||
attribute_aliases_spec.rb | ||
attribute_existing_on_object_spec.rb | ||
attributes_for_spec.rb | ||
attributes_from_instance_spec.rb | ||
attributes_ordered_spec.rb | ||
build_list_spec.rb | ||
build_spec.rb | ||
build_stubbed_spec.rb | ||
callbacks_spec.rb | ||
create_list_spec.rb | ||
create_pair_spec.rb | ||
create_spec.rb | ||
define_child_before_parent_spec.rb | ||
defining_methods_inside_a_factory_spec.rb | ||
definition_camel_string_spec.rb | ||
definition_spec.rb | ||
definition_without_block_spec.rb | ||
enum_traits_spec.rb | ||
global_initialize_with_spec.rb | ||
global_to_create_spec.rb | ||
initialize_with_spec.rb | ||
keyed_by_class_spec.rb | ||
lint_spec.rb | ||
modify_factories_spec.rb | ||
modify_inherited_spec.rb | ||
nested_attributes_spec.rb | ||
overrides_spec.rb | ||
parent_spec.rb | ||
private_attributes_spec.rb | ||
register_strategies_spec.rb | ||
reload_spec.rb | ||
sequence_context_spec.rb | ||
sequence_resetting_spec.rb | ||
sequence_spec.rb | ||
skip_create_spec.rb | ||
stub_spec.rb | ||
syntax_methods_within_dynamic_attributes_spec.rb | ||
traits_spec.rb | ||
transient_attributes_spec.rb |