gitlab-org--gitlab-foss/spec/factories/gitaly/commit.rb

21 lines
572 B
Ruby
Raw Normal View History

# frozen_string_literal: true
FactoryBot.define do
2017-09-20 18:28:57 -04:00
sequence(:gitaly_commit_id) { Digest::SHA1.hexdigest(Time.now.to_f.to_s) }
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" }
2017-09-20 18:28:57 -04:00
body { subject + "\nMy body" }
author { association(:gitaly_commit_author) }
committer { association(:gitaly_commit_author) }
2017-09-20 18:28:57 -04:00
end
end