Created
May 2, 2018 23:11
-
-
Save alvinsng/b1131ce726b5f9993973bf6a9134ef27 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # In spec/factories/account.rb | |
| FactoryBot.define do | |
| sequence(:email) { |n| "test_email_#{n}@example.com" } | |
| end | |
| # In Spring parent | |
| def seed_db | |
| 100.times { create(:account) } | |
| end | |
| seed_db # creates 100 accounts with sequences 1 to 100 | |
| # In Spring fork's spec run | |
| let(:account) { create(:account) } # this errors as sequence is 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment