Welcome to mirror list, hosted at ThFree Co, Russian Federation.

wikis.rb « factories « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 05f6fb0de58f3f2999fcc789dfe5e37bb41b2e59 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# frozen_string_literal: true

FactoryBot.define do
  factory :wiki do
    transient do
      container { association(:project) }
      user { container.default_owner || association(:user) }
    end

    initialize_with { Wiki.for_container(container, user) }
    skip_create

    factory :project_wiki do
      transient do
        project { association(:project) }
      end

      container { project }
    end

    trait :empty_repo do
      after(:create, &:create_wiki_repository)
    end
  end
end