summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Vosmaer <contact@jacobvosmaer.nl>2016-03-24 17:34:56 +0100
committerJacob Vosmaer <contact@jacobvosmaer.nl>2016-03-24 17:34:56 +0100
commitaae577f92141f3ec973b4dd362452502274147f5 (patch)
tree6bb96441dec157ebce090837936d3bbb57ddd7c9
parent1433068ad951045a3440d58b86e9489001ff3774 (diff)
downloadgitlab-ce-aae577f92141f3ec973b4dd362452502274147f5.tar.gz
Add test for gitlab_shell.upload_pack config setting
-rw-r--r--spec/requests/git_http_spec.rb15
1 files changed, 14 insertions, 1 deletions
diff --git a/spec/requests/git_http_spec.rb b/spec/requests/git_http_spec.rb
index 1e3f3f3e617..3a6a9b7a70d 100644
--- a/spec/requests/git_http_spec.rb
+++ b/spec/requests/git_http_spec.rb
@@ -52,12 +52,25 @@ describe 'Git HTTP requests', lib: true do
let(:env) { {} }
context "when the project is public" do
- it "responds with status 200" do
+ before do
project.update_attribute(:visibility_level, Project::PUBLIC)
+ end
+
+ it "responds with status 200" do
download(path, env) do |response|
expect(response.status).to eq(200)
end
end
+
+ context 'but git-upload-pack is disabled' do
+ it "responds with status 404" do
+ allow(Gitlab.config.gitlab_shell).to receive(:upload_pack).and_return(false)
+
+ download(path, env) do |response|
+ expect(response.status).to eq(404)
+ end
+ end
+ end
end
context "when the project is private" do