diff options
author | Robert Speicher <robert@gitlab.com> | 2015-10-23 11:31:01 +0000 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2015-10-23 11:31:01 +0000 |
commit | 2b51823017faec1d75852bcd318bd502099d692d (patch) | |
tree | 92adba83b1b34695a5276c92663302052f2076b2 /spec | |
parent | 7f5acdb20ac9b5908e6cf15c8fb5f7952a745f1c (diff) | |
parent | 69e5e260b0bd28cd48983494b2765e1cef0d3c38 (diff) | |
download | gitlab-ce-2b51823017faec1d75852bcd318bd502099d692d.tar.gz |
Merge branch 'fix-wiki-clone-over-http' into 'master'
Fix cloning Wiki repositories via HTTP
Cloning a project Wiki over HTTP would end up cloning the main repository
since the .wiki extension was being stripped.
Closes #3106
See merge request !1676
Diffstat (limited to 'spec')
-rw-r--r-- | spec/lib/gitlab/backend/grack_auth_spec.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/lib/gitlab/backend/grack_auth_spec.rb b/spec/lib/gitlab/backend/grack_auth_spec.rb index 37c527221a0..dfa0e10318a 100644 --- a/spec/lib/gitlab/backend/grack_auth_spec.rb +++ b/spec/lib/gitlab/backend/grack_auth_spec.rb @@ -50,6 +50,22 @@ describe Grack::Auth do end end + context "when the Wiki for a project exists" do + before do + @wiki = ProjectWiki.new(project) + env["PATH_INFO"] = "#{@wiki.repository.path_with_namespace}.git/info/refs" + project.update_attribute(:visibility_level, Project::PUBLIC) + end + + it "responds with the right project" do + response = auth.call(env) + json_body = ActiveSupport::JSON.decode(response[2][0]) + + expect(response.first).to eq(200) + expect(json_body['RepoPath']).to include(@wiki.repository.path_with_namespace) + end + end + context "when the project exists" do before do env["PATH_INFO"] = project.path_with_namespace + ".git" |