Sha256: c56382dc6e2eee2637820a4a53cd736e7c613859cf48f3505328bce050534eda

Contents?: true

Size: 538 Bytes

Versions: 14

Compression:

Stored size: 538 Bytes

Contents

# frozen_string_literal: true

require 'spree/testing_support/sequences'
require 'spree/testing_support/factories/role_factory'
require 'spree/testing_support/factories/address_factory'

FactoryBot.define do
  factory :user, class: Spree::UserClassHandle.new do
    email    { generate(:email) }
    password { 'lubieplacki' }

    trait :admin do
      spree_roles { [Spree::Role.find_by(name: 'admin') || create(:role, name: 'admin')] }
    end

    trait :with_addresses do |_u|
      bill_address
      ship_address
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
solidus_core_devise_token_auth-2.8.0.alpha.14 lib/spree/testing_support/factories/user_factory.rb
solidus_core_devise_token_auth-2.8.0.alpha.13 lib/spree/testing_support/factories/user_factory.rb
solidus_core_devise_token_auth-2.8.0.alpha.12 lib/spree/testing_support/factories/user_factory.rb
solidus_core_devise_token_auth-2.8.0.alpha.11 lib/spree/testing_support/factories/user_factory.rb
solidus_core_devise_token_auth-2.8.0.alpha.10 lib/spree/testing_support/factories/user_factory.rb
solidus_core_devise_token_auth-2.8.0.alpha.9 lib/spree/testing_support/factories/user_factory.rb
solidus_core_devise_token_auth-2.8.0.alpha.8 lib/spree/testing_support/factories/user_factory.rb
solidus_core_devise_token_auth-2.8.0.alpha.7 lib/spree/testing_support/factories/user_factory.rb
solidus_core_devise_token_auth-2.8.0.alpha.6 lib/spree/testing_support/factories/user_factory.rb
solidus_core_devise_token_auth-2.8.0.alpha.5 lib/spree/testing_support/factories/user_factory.rb
solidus_core_devise_token_auth-2.8.0.alpha.4 lib/spree/testing_support/factories/user_factory.rb
solidus_core_devise_token_auth-2.8.0.alpha.3 lib/spree/testing_support/factories/user_factory.rb
solidus_core_devise_token_auth-2.8.0.alpha.1 lib/spree/testing_support/factories/user_factory.rb
solidus_core_devise_token_auth-2.8.0.alpha.0 lib/spree/testing_support/factories/user_factory.rb