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 f606018a78 Raise more helpful error for invalid attribute
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}'
```
2020-06-22 20:01:32 -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 Raise more helpful error for invalid attribute 2020-06-22 20:01:32 -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 Run standardrb 2020-06-10 17:11:39 -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