2021-06-01 12:20:20 +00:00
|
|
|
# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
|
|
|
|
|
2017-11-21 21:50:03 +00:00
|
|
|
FactoryBot.define do
|
2019-02-19 10:29:42 +00:00
|
|
|
factory :token, aliases: %i[token_api api_token] do
|
2018-12-13 09:10:32 +00:00
|
|
|
user
|
2019-02-19 10:29:42 +00:00
|
|
|
action { 'api' }
|
|
|
|
persistent { true }
|
2021-04-01 15:14:25 +00:00
|
|
|
preferences do
|
|
|
|
|
2021-06-23 11:35:27 +00:00
|
|
|
permission_hash = permissions.index_with do |_permission|
|
|
|
|
true
|
2021-04-01 15:14:25 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
{
|
|
|
|
permission: permission_hash
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
transient do
|
|
|
|
permissions { [] }
|
|
|
|
end
|
2019-02-19 10:29:42 +00:00
|
|
|
|
|
|
|
factory :token_password_reset, aliases: %i[password_reset_token] do
|
|
|
|
action { 'PasswordReset' }
|
|
|
|
end
|
2017-02-24 17:27:27 +00:00
|
|
|
|
2019-02-19 10:29:42 +00:00
|
|
|
factory :token_ical, aliases: %i[ical_token] do
|
|
|
|
action { 'iCal' }
|
|
|
|
persistent { true }
|
|
|
|
end
|
2017-02-24 17:27:27 +00:00
|
|
|
end
|
|
|
|
end
|