diff options
author | Michael Kozono <mkozono@gmail.com> | 2017-06-15 17:17:24 -0700 |
---|---|---|
committer | Michael Kozono <mkozono@gmail.com> | 2017-06-16 14:14:19 -0700 |
commit | 32b3d09ae5ed778b8d884cd6722f748b39bf87f3 (patch) | |
tree | 73e5dc98b1589281d497a2b35050990dc9cab295 | |
parent | 8ef3bc5d754e307628027b607dd38ebc00826502 (diff) | |
download | gitlab-ce-32b3d09ae5ed778b8d884cd6722f748b39bf87f3.tar.gz |
Add specific test case
This test and its context exist only to ensure this behavior is fixed: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/11259#note_29262426
-rw-r--r-- | spec/requests/git_http_spec.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/requests/git_http_spec.rb b/spec/requests/git_http_spec.rb index 000d552bb75..b08148eca3c 100644 --- a/spec/requests/git_http_spec.rb +++ b/spec/requests/git_http_spec.rb @@ -316,6 +316,26 @@ describe 'Git HTTP requests', lib: true do it_behaves_like 'pushes require Basic HTTP Authentication' end end + + context 'and the user requests a redirected path' do + let!(:redirect) { project.route.create_redirect('foo/bar') } + let(:path) { "#{redirect.path}.git" } + let(:project_moved_message) do + <<-MSG.strip_heredoc + Project '#{redirect.path}' was moved to '#{project.full_path}'. + + Please update your Git remote and try again: + + git remote set-url origin #{project.http_url_to_repo} + MSG + end + + it 'downloads get status 404 with "project was moved" message' do + clone_get(path, {}) + expect(response).to have_http_status(:not_found) + expect(response.body).to match(project_moved_message) + end + end end context "when the project is private" do |