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

4 commits

Author SHA1 Message Date
Sweta
5ccc564923
Fix self referencing trait error (#1294)
If a new trait is defined with attributes,  check if attributes matches the name of
the trait. Raise an error if so, to avoid a recursive call to the
trait.

Co-authored-by: Daniel Colsen <daniel.j.colson@thoughtbot.com>
Co-authored-by: Paras Sanghavi <sanghaviparas@gmail.com>
2019-09-10 16:24:20 -07:00
Jared Beck
bfeec78f29 Raise helpful error block given to association
Closes #1033

> Arguably, association should raise and let the developer know
> they're using it in an unexpected way. I'd love to see a PR for
> that (with a test!), so if you're interested in contributing that,
> please do!
> https://github.com/thoughtbot/factory_girl/issues/1032#issuecomment-329297006

Co-authored-by: Daniel Colson <danieljamescolson@gmail.com>
2018-10-28 19:12:34 -04:00
Daniel Colson
5b31b56d65 Remove warning about setter methods
This warning made sense when we had static attributes, since
somebody might try to write something like:

```rb
factory :composer do
  self.name = "Daniel"
end
```

That would create a static declaration when the factory was defined,
then raise the error about avoiding writers when the factory was run.

Now this code will raise a NoMethodError right away when the factory is
being defined.
2018-09-28 16:59:48 -04: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
Renamed from lib/factory_girl/errors.rb (Browse further)