Sha256: 07060203957ad02ecb3e9230683a7424f349be103b1ac4273a6dae4fa2bb69be
Contents?: true
Size: 921 Bytes
Versions: 7
Compression:
Stored size: 921 Bytes
Contents
require 'spree/testing_support/sequences' require 'spree/testing_support/factories/role_factory' require 'spree/testing_support/factories/address_factory' FactoryGirl.define do sequence :user_authentication_token do |n| "xxxx#{Time.current.to_i}#{rand(1000)}#{n}xxxxxxxxxxxxx" end factory :user, class: Spree.user_class do email { generate(:random_email) } login { email } password 'secret' password_confirmation { password } authentication_token { generate(:user_authentication_token) } if Spree.user_class.attribute_method? :authentication_token trait :with_api_key do after(:create) do |user, _| user.generate_spree_api_key! end end factory :admin_user do spree_roles { [Spree::Role.find_by(name: 'admin') || create(:role, name: 'admin')] } end factory :user_with_addresses do |u| bill_address ship_address end end end
Version data entries
7 entries across 7 versions & 1 rubygems