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

5 commits

Author SHA1 Message Date
Yudai Takada
09053ea0ef
Fix some typo (#1542)
* Fix typo "delcaration" -> "declaration"

* Fix typo "Ususually" -> "Usually"

* Fix typo "assocition" -> "association"

* Fix typo "vaue" -> "value"
2022-06-08 07:01:10 -04:00
Alejandro Dustet
5947e10578 Deprecate and move to Internal sequence methods
Why:
Another run of internal methods that should not be publicly
available from the base namespace.
This time the sequence involving methods were moved. It's worth noticing
that the ```Internal``` class is getting crowded. Maybe we can start
name-spacing the internal groups into modules under
```internal/sequence.rb``` ```internal/trait.rb``` and so on. Thoughts?

This PR:

- Moves the ```register_sequence```, ```sequence_by_name```,
```sequences``` and ```rewind_sequences``` to the
```FactoryBot::Internal``` module.
- Deprecates uses of ```sequence_by_name```, and ```sequences```
from the ```FactoryBot``` module.
- Refactor rewind sequences test to use spies

This is one of the steps towards fixing [this
issue](https://github.com/thoughtbot/factory_bot/pull/1285#1281)
2019-06-04 19:02:51 -04:00
Daniel Colson
2b524b060d Raise more meaningful error for unregistered trait
Closes #970

In this code we are passing an implicit declaration `user`, rather than
the symbol `:user`:

```rb
factory :post do
  author factory: user
end
```

This will raise a confusing error:
`undefined method 'name' for :comment:Symbol`.

This is coming from the implicit declaration `#==` method,
called on lib/factory_bot/attribute_list.rb#56.
The method wasn't ever designed to compare against
objects of different classes. I added some tests for all the declaration
classes to handle being compared against other kinds of objects.

Co-authored-by: Dusan Orlovic <duleorlovic@gmail.com>
2018-10-31 12:50:39 -04: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