Sha256: 93a7340b7097355972360bfed4400880d027e8aa81cddf927a03541c9bd0f287

Contents?: true

Size: 592 Bytes

Versions: 15

Compression:

Stored size: 592 Bytes

Contents

FactoryGirl.define do
  sequence :user_authentication_token do |n|
    "xxxx#{Time.now.to_i}#{rand(1000)}#{n}xxxxxxxxxxxxx"
  end

  factory :user, :class => Spree.user_class do
    email { Faker::Internet.email }
    login { email }
    password 'secret'
    password_confirmation 'secret'
    authentication_token { FactoryGirl.generate(:user_authentication_token) } if Spree.user_class.attribute_method? :authentication_token
  end

  factory :admin_user, :parent => :user do
    spree_roles { [Spree::Role.find_by_name('admin') || FactoryGirl.create(:role, :name => 'admin')] }
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
spree_core-1.3.5 lib/spree/core/testing_support/factories/user_factory.rb
spree_core-1.3.4 lib/spree/core/testing_support/factories/user_factory.rb
spree_core-1.3.3 lib/spree/core/testing_support/factories/user_factory.rb
spree_core-1.2.5 lib/spree/core/testing_support/factories/user_factory.rb
spree_core-1.2.4 lib/spree/core/testing_support/factories/user_factory.rb
spree_core-1.3.2 lib/spree/core/testing_support/factories/user_factory.rb
spree_core-1.2.3 lib/spree/core/testing_support/factories/user_factory.rb
spree_core-1.3.1 lib/spree/core/testing_support/factories/user_factory.rb
spree_core-1.3.0 lib/spree/core/testing_support/factories/user_factory.rb
spree_core-1.3.0.rc2 lib/spree/core/testing_support/factories/user_factory.rb
dup_spree_core-1.3.0.rc1 lib/spree/core/testing_support/factories/user_factory.rb
spree_core-1.3.0.rc1 lib/spree/core/testing_support/factories/user_factory.rb
spree_core-1.2.2 lib/spree/core/testing_support/factories/user_factory.rb
spree_core-1.2.0 lib/spree/core/testing_support/factories/user_factory.rb
spree_core-1.2.0.rc2 lib/spree/core/testing_support/factories/user_factory.rb