diff options
Diffstat (limited to 'spec/factories/gitaly')
-rw-r--r-- | spec/factories/gitaly/commit.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/factories/gitaly/commit.rb b/spec/factories/gitaly/commit.rb index 4e8220e449a..ecf3e4e065e 100644 --- a/spec/factories/gitaly/commit.rb +++ b/spec/factories/gitaly/commit.rb @@ -16,5 +16,15 @@ FactoryBot.define do body { subject + "\nMy body" } author { association(:gitaly_commit_author) } committer { association(:gitaly_commit_author) } + + trailers do + trailers = body.lines.keep_if { |l| l =~ /.*: / }.map do |l| + key, value = *l.split(":").map(&:strip) + + Gitaly::CommitTrailer.new(key: key, value: value) + end + + Google::Protobuf::RepeatedField.new(:message, Gitaly::CommitTrailer, trailers) + end end end |