Add spec for compare service
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
parent
ac4db38094
commit
1bb64ec994
1 changed files with 21 additions and 0 deletions
21
spec/services/compare_service_spec.rb
Normal file
21
spec/services/compare_service_spec.rb
Normal file
|
@ -0,0 +1,21 @@
|
|||
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
|
||||
subject { service.execute(project, 'feature', project, 'fix', false) }
|
||||
|
||||
it { expect(subject.diffs.size).to eq(1) }
|
||||
end
|
||||
|
||||
context 'straight compare, like feature..fix' do
|
||||
subject { service.execute(project, 'feature', project, 'fix', true) }
|
||||
|
||||
it { expect(subject.diffs.size).to eq(3) }
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue