2016-09-29 10:21:19 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe CompareService, services: true do
|
|
|
|
let(:project) { create(:project) }
|
|
|
|
let(:user) { create(:user) }
|
|
|
|
let(:service) { described_class.new }
|
|
|
|
|
|
|
|
describe '#execute' do
|
|
|
|
context 'compare with base, like feature...fix' do
|
2016-10-12 06:27:59 -04:00
|
|
|
subject { service.execute(project, 'feature', 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-10-12 06:27:59 -04:00
|
|
|
subject { service.execute(project, 'feature', project, 'fix', straight: true) }
|
2016-09-29 10:21:19 -04:00
|
|
|
|
|
|
|
it { expect(subject.diffs.size).to eq(3) }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|