Sha256: 1c61997a43cc347ed5f8985e067240cd51500ffff5d65e4bc12f2c5404dff29d
Contents?: true
Size: 1.23 KB
Versions: 5
Compression:
Stored size: 1.23 KB
Contents
# frozen_string_literal: true FactoryGirl.define do factory :g5_authenticatable_client_user, parent: :g5_authenticatable_user do transient do clients nil client_count 1 role_factory :g5_authenticatable_client_role end after(:create) do |user, evaluator| user.roles.clear user.roles << if evaluator.clients evaluator.clients.collect do |client| create(evaluator.role_factory, resource: client) end else create_list(evaluator.role_factory, evaluator.client_count) end end end factory :g5_authenticatable_client_admin, parent: :g5_authenticatable_client_user do transient do role_factory :g5_authenticatable_client_admin_role end end factory :g5_authenticatable_client_editor, parent: :g5_authenticatable_client_user do transient do role_factory :g5_authenticatable_client_editor_role end end factory :g5_authenticatable_client_viewer, parent: :g5_authenticatable_client_user do transient do role_factory :g5_authenticatable_client_viewer_role end end end
Version data entries
5 entries across 5 versions & 1 rubygems