debian-mirror-gitlab/spec/services/compare_service_spec.rb

22 lines
585 B
Ruby
Raw Normal View History

2016-11-03 12:29:30 +05:30
require 'spec_helper'
2017-09-10 17:25:29 +05:30
describe CompareService do
2017-08-17 22:00:37 +05:30
let(:project) { create(:project, :repository) }
2016-11-03 12:29:30 +05:30
let(:user) { create(:user) }
2017-08-17 22:00:37 +05:30
let(:service) { described_class.new(project, 'feature') }
2016-11-03 12:29:30 +05:30
describe '#execute' do
context 'compare with base, like feature...fix' do
2017-08-17 22:00:37 +05:30
subject { service.execute(project, 'fix', straight: false) }
2016-11-03 12:29:30 +05:30
it { expect(subject.diffs.size).to eq(1) }
end
context 'straight compare, like feature..fix' do
2017-08-17 22:00:37 +05:30
subject { service.execute(project, 'fix', straight: true) }
2016-11-03 12:29:30 +05:30
it { expect(subject.diffs.size).to eq(3) }
end
end
end