dawarich/spec/factories/users.rb

56 lines
1.1 KiB
Ruby
Raw Normal View History

2024-07-19 14:37:57 -04:00
# frozen_string_literal: true
FactoryBot.define do
2022-10-13 06:00:39 -04:00
factory :user do
sequence :email do |n|
"user#{n}@example.com"
end
status { :active }
active_until { 1000.years.from_now }
password { SecureRandom.hex(8) }
2024-07-19 14:37:57 -04:00
2024-08-28 14:24:35 -04:00
settings do
{
2025-07-21 14:22:18 -04:00
'route_opacity' => 60,
'meters_between_routes' => '500',
'minutes_between_routes' => '30',
2025-05-26 14:33:48 -04:00
'fog_of_war_meters' => '100',
'time_threshold_minutes' => '30',
'merge_threshold_minutes' => '15',
2025-05-26 14:33:48 -04:00
'maps' => {
'distance_unit' => 'km'
}
2024-08-28 14:24:35 -04:00
}
end
2024-07-19 14:37:57 -04:00
trait :admin do
admin { true }
end
2024-11-26 14:18:08 -05:00
trait :inactive do
status { :inactive }
active_until { 1.day.ago }
end
trait :with_immich_integration do
2024-11-26 14:18:08 -05:00
settings do
{
immich_url: 'https://immich.example.com',
immich_api_key: '1234567890'
}
end
end
trait :with_photoprism_integration do
settings do
{
photoprism_url: 'https://photoprism.example.com',
photoprism_api_key: '1234567890'
}
end
end
end
end