FactoryBot.define do factory :user do sequence( :email ){|i| "test#{i}@example.com" } password { "secret" } trait :other_auth do sequence( :email ){|i| "test-other-user#{i}@example.com" } auth_data {{ 'info' => { 'nickname' => "UOther", "name" => "USR Other", "first_name" => "Usother" }, "credentials" => { "token" => "fbAuthToken234", 'expires' => false } }} end end end