Sha256: e0d53dbf8670798007c65946d506b7eb455049a621aabdd10c4b4d2236e04d3a

Contents?: true

Size: 1.3 KB

Versions: 5

Compression:

Stored size: 1.3 KB

Contents

# frozen_string_literal: true

FactoryGirl.define do
  factory :g5_authenticatable_user, class: 'G5Authenticatable::User' do
    sequence(:email) { |n| "test.user#{n}@test.host" }
    provider 'g5'
    sequence(:uid) { |n| "abc123-#{n}" }
    sequence(:g5_access_token) { |n| "secret_token_#{n}" }
    first_name 'Jane'
    last_name 'Doe'
    phone_number '(555) 867-5309'
    title 'Minister of Funny Walks'
    organization_name 'Department of Redundancy Department'
  end

  factory :g5_authenticatable_super_admin, parent: :g5_authenticatable_user do
    after(:build) do |user|
      user.roles.clear
      user.roles << FactoryGirl.build(:g5_authenticatable_super_admin_role)
    end
  end

  factory :g5_authenticatable_admin, parent: :g5_authenticatable_user do
    after(:build) do |user|
      user.roles.clear
      user.roles << FactoryGirl.build(:g5_authenticatable_admin_role)
    end
  end

  factory :g5_authenticatable_editor, parent: :g5_authenticatable_user do
    after(:build) do |user|
      user.roles.clear
      user.roles << FactoryGirl.build(:g5_authenticatable_editor_role)
    end
  end

  factory :g5_authenticatable_viewer, parent: :g5_authenticatable_user do
    after(:build) do |user|
      user.roles.clear
      user.roles << FactoryGirl.build(:g5_authenticatable_viewer_role)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
g5_authenticatable-1.0.0 lib/g5_authenticatable/test/factories/global_users.rb
g5_authenticatable-1.0.0.pre.4 lib/g5_authenticatable/test/factories/global_users.rb
g5_authenticatable-1.0.0.pre.3 lib/g5_authenticatable/test/factories/global_users.rb
g5_authenticatable-1.0.0.pre.2 lib/g5_authenticatable/test/factories/global_users.rb
g5_authenticatable-1.0.0.pre.1 lib/g5_authenticatable/test/factories/global_users.rb