2022-01-01 13:38:12 +00:00
|
|
|
# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
|
2021-06-01 12:20:20 +00:00
|
|
|
|
2017-11-21 21:50:03 +00:00
|
|
|
FactoryBot.define do
|
2017-06-16 20:43:09 +00:00
|
|
|
factory :role do
|
2019-03-27 09:01:36 +00:00
|
|
|
sequence(:name) { |n| "TestRole#{n}" }
|
|
|
|
created_by_id { 1 }
|
|
|
|
updated_by_id { 1 }
|
2019-01-15 12:55:59 +00:00
|
|
|
|
2022-02-24 11:15:19 +00:00
|
|
|
transient do
|
|
|
|
permission_names { nil }
|
|
|
|
end
|
|
|
|
|
|
|
|
permissions { Permission.where(name: permission_names) }
|
|
|
|
|
2019-01-15 12:55:59 +00:00
|
|
|
factory :agent_role do
|
|
|
|
permissions { Permission.where(name: 'ticket.agent') }
|
|
|
|
end
|
2020-09-14 06:34:42 +00:00
|
|
|
|
2020-10-29 14:43:14 +00:00
|
|
|
trait :customer do
|
|
|
|
permissions { Permission.where(name: 'ticket.customer') }
|
|
|
|
end
|
|
|
|
|
2020-09-14 06:34:42 +00:00
|
|
|
trait :admin do
|
|
|
|
permissions { Permission.where(name: 'admin') }
|
|
|
|
end
|
2017-06-16 20:43:09 +00:00
|
|
|
end
|
|
|
|
end
|