2020-04-22 08:09:29 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
FactoryBot.define do
|
|
|
|
factory :wiki do
|
|
|
|
transient do
|
2020-09-24 08:09:37 -04:00
|
|
|
container { association(:project) }
|
2022-01-18 22:14:09 -05:00
|
|
|
user { container.first_owner || association(:user) }
|
2020-04-22 08:09:29 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
initialize_with { Wiki.for_container(container, user) }
|
|
|
|
skip_create
|
|
|
|
|
|
|
|
factory :project_wiki do
|
|
|
|
transient do
|
2020-09-24 08:09:37 -04:00
|
|
|
project { association(:project) }
|
2020-04-22 08:09:29 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
container { project }
|
|
|
|
end
|
2020-11-10 19:08:58 -05:00
|
|
|
|
|
|
|
trait :empty_repo do
|
|
|
|
after(:create, &:create_wiki_repository)
|
|
|
|
end
|
2020-04-22 08:09:29 -04:00
|
|
|
end
|
|
|
|
end
|