2016-09-13 17:45:13 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
describe Gitlab::Conflict::FileCollection do
|
2016-09-13 17:45:13 +05:30
|
|
|
let(:merge_request) { create(:merge_request, source_branch: 'conflict-resolvable', target_branch: 'conflict-start') }
|
2018-03-17 18:26:18 +05:30
|
|
|
let(:file_collection) { described_class.new(merge_request) }
|
2016-09-13 17:45:13 +05:30
|
|
|
|
|
|
|
describe '#files' do
|
|
|
|
it 'returns an array of Conflict::Files' do
|
|
|
|
expect(file_collection.files).to all(be_an_instance_of(Gitlab::Conflict::File))
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
describe '#default_commit_message' do
|
|
|
|
it 'matches the format of the git CLI commit message' do
|
|
|
|
expect(file_collection.default_commit_message).to eq(<<EOM.chomp)
|
|
|
|
Merge branch 'conflict-start' into 'conflict-resolvable'
|
|
|
|
|
|
|
|
# Conflicts:
|
|
|
|
# files/ruby/popen.rb
|
|
|
|
# files/ruby/regex.rb
|
|
|
|
EOM
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|