gitlab-org--gitlab-foss/spec/services/compare_service_spec.rb
Lin Jen-Shin 8384d0d8d5 Introduce Repository#with_tmp_ref which we need
commits from the other repository. We'll cleanup
the tmp ref after we're done with our business.
2016-12-08 17:57:52 +08:00

21 lines
588 B
Ruby

require 'spec_helper'
describe CompareService, services: true do
let(:project) { create(:project) }
let(:user) { create(:user) }
let(:service) { described_class.new(project, 'feature') }
describe '#execute' do
context 'compare with base, like feature...fix' do
subject { service.execute(project, 'fix', straight: false) }
it { expect(subject.diffs.size).to eq(1) }
end
context 'straight compare, like feature..fix' do
subject { service.execute(project, 'fix', straight: true) }
it { expect(subject.diffs.size).to eq(3) }
end
end
end