f540ffcef6
Using the sed script from https://gitlab.com/gitlab-org/gitlab-ce/issues/59758
19 lines
517 B
Ruby
19 lines
517 B
Ruby
# frozen_string_literal: true
|
|
|
|
require 'spec_helper'
|
|
|
|
describe Gitlab::Checks::ForcePush do
|
|
set(:project) { create(:project, :repository) }
|
|
|
|
describe '.force_push?' do
|
|
it 'returns false if the repo is empty' do
|
|
allow(project).to receive(:empty_repo?).and_return(true)
|
|
|
|
expect(described_class.force_push?(project, 'HEAD', 'HEAD~')).to be(false)
|
|
end
|
|
|
|
it 'checks if old rev is an anchestor' do
|
|
expect(described_class.force_push?(project, 'HEAD', 'HEAD~')).to be(true)
|
|
end
|
|
end
|
|
end
|