diff options
author | Douwe Maan <douwe@gitlab.com> | 2017-01-26 01:23:38 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2017-01-26 01:23:38 +0300 |
commit | d1eb85dd30d0f67874b55bd1c1be5d611e1644f6 (patch) | |
tree | 9a96621610aca6d3c4b88d1da1b0209fa83a689f /spec | |
parent | a24e9a0e3c65093a6eb618bd232639a689e19e70 (diff) | |
parent | 58aad16d1cb859cdf99e93e0b2ceaab64b1ea5a3 (diff) |
Merge branch 'fix/26518' into 'master'
Fix access to the wiki code via HTTP when repository feature disabled
Closes #26518
See merge request !8758
Diffstat (limited to 'spec')
-rw-r--r-- | spec/requests/git_http_spec.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/requests/git_http_spec.rb b/spec/requests/git_http_spec.rb index 5abda28e26f..6a5ad6deb74 100644 --- a/spec/requests/git_http_spec.rb +++ b/spec/requests/git_http_spec.rb @@ -55,6 +55,28 @@ describe 'Git HTTP requests', lib: true do expect(response.content_type.to_s).to eq(Gitlab::Workhorse::INTERNAL_API_CONTENT_TYPE) end end + + context 'but the repo is disabled' do + let(:project) { create(:project, repository_access_level: ProjectFeature::DISABLED, wiki_access_level: ProjectFeature::ENABLED) } + let(:wiki) { ProjectWiki.new(project) } + let(:path) { "/#{wiki.repository.path_with_namespace}.git" } + + before do + project.team << [user, :developer] + end + + it 'allows clones' do + download(path, user: user.username, password: user.password) do |response| + expect(response).to have_http_status(200) + end + end + + it 'allows pushes' do + upload(path, user: user.username, password: user.password) do |response| + expect(response).to have_http_status(200) + end + end + end end context "when the project exists" do |