trabajo-afectivo/spec/factories/token.rb
Thorsten Eckel ca56de3648 Maintenance: Updated to Rails 6.0.4 and the new Zeitwerk autoloader.
This changes the minimum supported version of PostgreSQL to 9.3.
2021-06-23 11:35:27 +00:00

33 lines
659 B
Ruby

# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
FactoryBot.define do
factory :token, aliases: %i[token_api api_token] do
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