2016-09-29 10:21:19 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2017-07-10 10:24:02 -04:00
|
|
|
describe CompareService do
|
2017-03-27 17:14:01 -04:00
|
|
|
let(:project) { create(:project, :repository) }
|
2016-09-29 10:21:19 -04:00
|
|
|
let(:user) { create(:user) }
|
2016-12-08 04:57:52 -05:00
|
|
|
let(:service) { described_class.new(project, 'feature') }
|
2016-09-29 10:21:19 -04:00
|
|
|
|
|
|
|
describe '#execute' do
|
|
|
|
context 'compare with base, like feature...fix' do
|
2016-12-08 04:57:52 -05:00
|
|
|
subject { service.execute(project, 'fix', straight: false) }
|
2016-09-29 10:21:19 -04:00
|
|
|
|
|
|
|
it { expect(subject.diffs.size).to eq(1) }
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'straight compare, like feature..fix' do
|
2016-12-08 04:57:52 -05:00
|
|
|
subject { service.execute(project, 'fix', straight: true) }
|
2016-09-29 10:21:19 -04:00
|
|
|
|
|
|
|
it { expect(subject.diffs.size).to eq(3) }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|