Commit 319fcaf4 authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre

Merge branch '13053-sync-design-repositories' into 'master'

Exposing design repository from primary to secondary

Closes #13053

See merge request gitlab-org/gitlab!16821
parents 9cb33f0a 29665e71
......@@ -3,8 +3,10 @@
module Gitlab
class GitAccessDesign < GitAccess
def check(cmd, _changes)
unless geo?
check_protocol!
check_can_create_design!
end
success_result(cmd)
end
......
......@@ -7,9 +7,10 @@ describe Gitlab::GitAccessDesign do
set(:project) { create(:project) }
set(:user) { project.owner }
let(:protocol) { 'web' }
let(:actor) { user }
subject(:access) do
described_class.new(user, project, protocol, authentication_abilities: [:read_project, :download_code, :push_code])
described_class.new(actor, project, protocol, authentication_abilities: [:read_project, :download_code, :push_code])
end
describe "#check!" do
......@@ -38,5 +39,15 @@ describe Gitlab::GitAccessDesign do
expect { subject }.to raise_error(::Gitlab::GitAccess::UnauthorizedError)
end
end
context 'Geo' do
let(:actor) { :geo }
context 'http protocol' do
let(:protocol) { 'http' }
it { is_expected.to be_a(::Gitlab::GitAccessResult::Success) }
end
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment