GitLab steht wegen Wartungsarbeiten am Montag, den 10. Mai, zwischen 17:00 und 19:00 Uhr nicht zur Verfügung.

compare_service_spec.rb 608 Bytes
Newer Older
1 2 3 4 5 6 7 8 9
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
10
      subject { service.execute(project, 'feature', project, 'fix', straight: false) }
11 12 13 14 15

      it { expect(subject.diffs.size).to eq(1) }
    end

    context 'straight compare, like feature..fix' do
16
      subject { service.execute(project, 'feature', project, 'fix', straight: true) }
17 18 19 20 21

      it { expect(subject.diffs.size).to eq(3) }
    end
  end
end