debian-mirror-gitlab/spec/factories/merge_request_diffs.rb

22 lines
709 B
Ruby
Raw Normal View History

2018-12-13 13:39:08 +05:30
# frozen_string_literal: true
FactoryBot.define do
factory :merge_request_diff do
2021-01-03 14:25:43 +05:30
association :merge_request, factory: :merge_request_without_merge_request_diff
2019-12-21 20:55:43 +05:30
state { :collected }
commits_count { 1 }
2018-12-13 13:39:08 +05:30
base_commit_sha { Digest::SHA1.hexdigest(SecureRandom.hex) }
head_commit_sha { Digest::SHA1.hexdigest(SecureRandom.hex) }
start_commit_sha { Digest::SHA1.hexdigest(SecureRandom.hex) }
2020-11-24 15:15:51 +05:30
trait :external do
external_diff { fixture_file_upload("spec/fixtures/doc_sample.txt", "plain/txt") }
stored_externally { true }
importing { true } # this avoids setting the state to 'empty'
end
factory :external_merge_request_diff, traits: [:external]
2018-12-13 13:39:08 +05:30
end
end