trabajo-afectivo/spec/factories/token.rb

33 lines
660 B
Ruby
Raw Permalink Normal View History

2022-01-01 13:38:12 +00:00
# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
FactoryBot.define do
factory :token, aliases: %i[token_api api_token] do
2018-12-13 09:10:32 +00:00
user
action { 'api' }
persistent { true }
preferences do
permission_hash = permissions.index_with do |_permission|
true
end
{
permission: permission_hash
}
end
transient do
permissions { [] }
end
factory :token_password_reset, aliases: %i[password_reset_token] do
action { 'PasswordReset' }
end
factory :token_ical, aliases: %i[ical_token] do
action { 'iCal' }
persistent { true }
end
end
end