2016-07-27 07:42:18 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2017-07-10 10:24:02 -04:00
|
|
|
describe Gitlab::Conflict::FileCollection do
|
2016-08-05 07:15:06 -04:00
|
|
|
let(:merge_request) { create(:merge_request, source_branch: 'conflict-resolvable', target_branch: 'conflict-start') }
|
2017-10-06 21:41:23 -04:00
|
|
|
let(:file_collection) { described_class.new(merge_request) }
|
2016-07-27 07:42:18 -04:00
|
|
|
|
|
|
|
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)
|
2016-08-05 07:15:06 -04:00
|
|
|
Merge branch 'conflict-start' into 'conflict-resolvable'
|
2016-07-27 07:42:18 -04:00
|
|
|
|
|
|
|
# Conflicts:
|
|
|
|
# files/ruby/popen.rb
|
|
|
|
# files/ruby/regex.rb
|
|
|
|
EOM
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|