November 23, 2020
How to sequence a number in Factory Bot
sequence(:email) { |n| "person#{n}@example.com" } factory :user do name { "Jane Doe" } email initialize_with { new(name) } end
create(:user)