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

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

FactoryBot.define do
  factory :snippet_repository do
    snippet

    after(:build) do |snippet_repository, _|
      snippet_repository.shard_name = snippet_repository.snippet.repository_storage
      snippet_repository.disk_path  = snippet_repository.snippet.disk_path
    end

    trait(:checksummed) do
      verification_checksum { 'abc' }
    end

    trait(:checksum_failure) do
      verification_failure { 'Could not calculate the checksum' }
    end
  end
end