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

Document value of a sequence can be any Enumerable

* Update GETTING_STARTED.md with mention Array#cycle
* Update GETTING_STARTED.md by move Array#cycle mention
* Remove unused TOC entry for GETTING_STARTED.md

Co-authored-by: Alexandr Borisov <ab@cifronomika.ru>
This commit is contained in:
Alexandr Borisov 2021-07-30 17:18:28 +03:00 committed by GitHub
parent d85f90fb16
commit 81aaf8d7f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1013,6 +1013,15 @@ factory :post do
end
```
Please note, that the value for the sequence could be any Enumerable instance,
as long as it responds to `#next`:
```ruby
factory :task do
sequence :priority, %i[low medium high urgent].cycle
end
```
### Aliases
Sequences can also have aliases. The sequence aliases share the same counter: