2019-03-07 02:27:40 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
FactoryBot.define do
|
|
|
|
factory :repository do
|
2019-03-07 16:05:35 +08:00
|
|
|
sequence(:name) { |n| "My repository-#{n}" }
|
2019-03-07 02:27:40 +08:00
|
|
|
created_by { create :user }
|
2022-06-07 00:21:57 +08:00
|
|
|
team { association :team, created_by: created_by }
|
2019-08-12 21:49:08 +08:00
|
|
|
trait :write_shared do
|
2019-08-29 23:17:38 +08:00
|
|
|
permission_level { :shared_write }
|
2019-08-12 21:49:08 +08:00
|
|
|
end
|
|
|
|
trait :read_shared do
|
2019-08-29 23:17:38 +08:00
|
|
|
permission_level { :shared_read }
|
2019-08-12 21:49:08 +08:00
|
|
|
end
|
2020-06-16 14:47:48 +08:00
|
|
|
trait :archived do
|
|
|
|
archived { true }
|
|
|
|
archived_on { Time.zone.now }
|
|
|
|
archived_by { created_by }
|
|
|
|
end
|
2019-03-07 02:27:40 +08:00
|
|
|
end
|
|
|
|
end
|