2016-09-29 10:21:19 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe CompareService, services: true do
|
|
|
|
let(:project) { create(:project) }
|
|
|
|
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
|