Sha256: 484b8123049c44a71c03665a7d281e60497b44245bf085152fb93168368240e6

Contents?: true

Size: 468 Bytes

Versions: 13

Compression:

Stored size: 468 Bytes

Contents

FactoryBot.define do
  sequence(:email) { |n| "email-#{n}@test.com" }

  factory :base_user, class: User do
    email
    password { 'a password' }
    password_confirmation { 'a password' }

    factory :user do
      after(:create) { |user| user.remove_role(:admin) }
    end

    factory :admin do
      after(:create) { |user| user.add_role(:admin) }
    end

    factory :superadmin do
      after(:create) { |user| user.add_role(:superadmin) }
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
samvera-persona-0.5.0 spec/factories/users.rb
samvera-persona-0.4.1 spec/factories/users.rb
samvera-persona-0.4.0 spec/factories/users.rb
samvera-persona-0.3.0 spec/factories/users.rb
samvera-persona-0.2.0 spec/factories/users.rb
samvera-persona-0.1.7 spec/factories/users.rb
samvera-persona-0.1.6 spec/factories/users.rb
samvera-persona-0.1.5 spec/factories/users.rb
samvera-persona-0.1.4 spec/factories/users.rb
samvera-persona-0.1.3 spec/factories/users.rb
samvera-persona-0.1.2 spec/factories/users.rb
samvera-persona-0.1.1 spec/factories/users.rb
samvera-persona-0.1.0 spec/factories/users.rb