Commit 9cfdef2f authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre

Merge branch 'unit_tests_for_disabled_wiki' into 'master'

Add spec to check that geo can download code from private repository

See merge request gitlab-org/gitlab-ee!7235
parents a7b0c5d5 683bffdd
......@@ -14,9 +14,9 @@ describe Gitlab::GitAccessWiki do
]
end
subject { access.check('git-receive-pack', changes) }
context "when in a read-only GitLab instance" do
subject { access.check('git-receive-pack', changes) }
before do
create(:protected_branch, name: 'feature', project: project)
allow(Gitlab::Database).to receive(:read_only?) { true }
......@@ -44,6 +44,18 @@ For more information: #{EE::Gitlab::GeoGitAccess::GEO_SERVER_DOCS_URL}"
end
end
context 'when wiki is disabled' do
let(:user) { :geo }
let(:project) { create(:project, :private, :wiki_repo, wiki_access_level: ProjectFeature::DISABLED) }
let(:authentication_abilities) { [:download_code] }
subject { access.check('git-upload-pack', changes) }
it 'allows code download for geo' do
expect(subject).to be_truthy
end
end
private
def raise_unauthorized(message)
......
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