Sha256: b9f42432b3e6e8a0e9cd51dc5034b49f805fd4934c7dbd4ce3270df77562e5e2

Contents?: true

Size: 767 Bytes

Versions: 4

Compression:

Stored size: 767 Bytes

Contents

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

    factory :site_admin do
      after(:create) do |user, evaluator|
        create_list(:role, 1, user: user, exhibit_id: nil, role: 'admin')
      end
    end

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

    factory :exhibit_visitor do
      
    end
  end
end
  

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
blacklight-spotlight-0.4.1 spec/factories/users.rb
blacklight-spotlight-0.3.1 spec/factories/users.rb
blacklight-spotlight-0.3.0 spec/factories/users.rb
blacklight-spotlight-0.2.0 spec/factories/users.rb