2019-07-25 01:11:48 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-12-13 19:13:44 -05:00
|
|
|
FactoryBot.define do
|
2017-09-20 18:28:57 -04:00
|
|
|
sequence(:gitaly_commit_id) { Digest::SHA1.hexdigest(Time.now.to_f.to_s) }
|
|
|
|
|
2020-01-09 13:07:52 -05:00
|
|
|
factory :gitaly_commit, class: 'Gitaly::GitCommit' do
|
2017-09-20 18:28:57 -04:00
|
|
|
skip_create
|
|
|
|
|
|
|
|
id { generate(:gitaly_commit_id) }
|
|
|
|
parent_ids do
|
|
|
|
ids = [generate(:gitaly_commit_id), generate(:gitaly_commit_id)]
|
|
|
|
Google::Protobuf::RepeatedField.new(:string, ids)
|
|
|
|
end
|
|
|
|
subject { "My commit" }
|
2019-10-18 07:11:44 -04:00
|
|
|
|
2017-09-20 18:28:57 -04:00
|
|
|
body { subject + "\nMy body" }
|
2021-03-16 11:11:17 -04:00
|
|
|
author { association(:gitaly_commit_author) }
|
|
|
|
committer { association(:gitaly_commit_author) }
|
2017-09-20 18:28:57 -04:00
|
|
|
end
|
|
|
|
end
|