1
0
Fork 0
mirror of https://github.com/thoughtbot/factory_bot.git synced 2022-11-09 11:43:51 -05:00
Commit graph

10 commits

Author SHA1 Message Date
Susan Wright
2995978188 Rubocop: Fix Layout/IndentHeredoc issues (#1215) 2018-10-07 22:46:58 -04:00
Daniel Colson
0473865b93 Remove static attributes
Co-authored-by: George Wambold <georgewambold@gmail.com>
2018-09-14 19:27:13 +00:00
Daniel Colson
bf04aaa068 Autocorrect all static attributes to dynamic
Most of this was fixed by adding the `attribute-defined-statically-cop`
branch of `thoughtbot/rubocop-rspec` to the Gemfile and running:

```sh
  rubocop \
    --require rubocop-rspec \
    --only FactoryBot/AttributeDefinedStatically \
    --auto-correct
```

I had to update the cucumber tests manually, and I realized our changes
don't handle `ignore` blocks or blocks with arity 1 that use the yielded
DefinitionProxy. I will update
https://github.com/rubocop-hq/rubocop-rspec/pull/666to handle these
cases.
2018-09-14 19:27:13 +00:00
Oli Peate
01d81f54b5 Remove unnecessary spec_helper requires
https://github.com/rspec/rspec/wiki#rspec
2018-05-21 18:03:28 +01:00
Avielle
c716ce01b4 Replace 'girl' with 'bot' everywhere (#1051)
Also: add a deprecation warning to factory_girl, asking users to switch to
factory_bot

https://github.com/thoughtbot/factory_girl/issues/921
2017-10-20 15:20:28 -04:00
Oliver Peate
0dadb2f19f Allow linting factory strategy to be specified (#1019) 2017-09-28 08:22:16 -04:00
Andrew Peterson
702487072c FactoryGirl.lint can lint traits
Why?

Traits are another way to extend or modify behavior of a factory;
because of this, applied traits may result in invalid factories, even if
the base factory is valid.

To enable this functionality, use:

    FactoryGirl.lint traits:true

Note that, because FactoryGirl uses the `create` strategy when linting,
this may greatly slow the time to lint factories.
2016-02-05 09:00:37 -05:00
Joshua Clayton
f451e4a419 Fresh pass at displaying more detail during linting 2014-10-17 16:40:39 -04:00
Joshua Clayton
5f465f718f Allow selective linting
Closes #653
2014-05-30 11:28:58 -04:00
Joshua Clayton
6a692fe711 Add FactoryGirl.lint to ensure all factories are valid
This commit adds FactoryGirl.lint, which iterates over each defined
factory, builds it, and ensures it is valid. If any factories are
invalid, an exception is raised and includes the names of each invalid
factory.
2014-02-07 22:21:08 -05:00