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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

28 lines
803 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
2021-03-11 19:13:27 +05:30
diff_type { :regular }
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
2021-03-11 19:13:27 +05:30
trait :merge_head do
diff_type { :merge_head }
end
2020-11-24 15:15:51 +05:30
factory :external_merge_request_diff, traits: [:external]
2018-12-13 13:39:08 +05:30
end
end