Sha256: 42d370f22b8ecb9bb382f8cd383b21b603ac50daab3caa7aaa82a6340838be59

Contents?: true

Size: 761 Bytes

Versions: 30

Compression:

Stored size: 761 Bytes

Contents

# frozen_string_literal: true

FactoryBot.define do
  factory :user do
    transient do
      exhibit { FactoryBot.create(:exhibit) }
    end
    sequence(:email) { |n| "user#{n}@example.com" }
    password { 'insecure' }

    factory :site_admin do
      after(:create) do |user, _evaluator|
        user.roles.create role: 'admin', resource: Spotlight::Site.instance
      end
    end

    factory :exhibit_admin do
      after(:create) do |user, evaluator|
        user.roles.create role: 'admin', resource: evaluator.exhibit
      end
    end
    factory :exhibit_curator do
      after(:create) do |user, evaluator|
        user.roles.create role: 'curator', resource: evaluator.exhibit
      end
    end

    factory :exhibit_visitor do
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
blacklight-spotlight-3.0.0.rc4 spec/factories/users.rb
blacklight-spotlight-3.0.0.rc3 spec/factories/users.rb
blacklight-spotlight-3.0.0.rc2 spec/factories/users.rb
blacklight-spotlight-3.0.0.rc1 spec/factories/users.rb
blacklight-spotlight-3.0.0.alpha.10 spec/factories/users.rb
blacklight-spotlight-3.0.0.alpha.9 spec/factories/users.rb
blacklight-spotlight-3.0.0.alpha.8 spec/factories/users.rb
blacklight-spotlight-3.0.0.alpha.7 spec/factories/users.rb
blacklight-spotlight-3.0.0.alpha.6 spec/factories/users.rb
blacklight-spotlight-3.0.0.alpha.5 spec/factories/users.rb
blacklight-spotlight-3.0.0.alpha.4 spec/factories/users.rb
blacklight-spotlight-3.0.0.alpha.3 spec/factories/users.rb
blacklight-spotlight-3.0.0.alpha.2 spec/factories/users.rb
blacklight-spotlight-3.0.0.alpha.1 spec/factories/users.rb
blacklight-spotlight-2.13.0 spec/factories/users.rb
blacklight-spotlight-2.12.1 spec/factories/users.rb
blacklight-spotlight-2.12.0 spec/factories/users.rb
blacklight-spotlight-2.11.0 spec/factories/users.rb
blacklight-spotlight-2.10.0 spec/factories/users.rb
blacklight-spotlight-2.9.0 spec/factories/users.rb