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

distribution.rb « debian « packages « factories « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 2015f2923b810a86984a593d432133fb65d4aa99 (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 :debian_project_distribution, class: 'Packages::Debian::ProjectDistribution' do
    container { association(:project) }

    sequence(:codename) { |n| "project-dist-#{n}" }

    factory :debian_group_distribution, class: 'Packages::Debian::GroupDistribution' do
      container { association(:group) }

      sequence(:codename) { |n| "group-dist-#{n}" }
    end

    trait(:with_file) do
      after(:build) do |distribution, evaluator|
        distribution.file = fixture_file_upload('spec/fixtures/packages/debian/README.md')
      end
    end

    trait(:object_storage) do
      file_store { Packages::PackageFileUploader::Store::REMOTE }
    end
  end
end