summaryrefslogtreecommitdiff
path: root/spec/controllers/projects_controller_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-06-14 13:38:57 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-06-14 13:38:57 +0000
commit10e18de60f55811137871acefd331d2d5a41f237 (patch)
treeb227511752fb7021acec83fd3b2b5499434ae7f8 /spec/controllers/projects_controller_spec.rb
parent757327a59bcaecb986b0c07ae0cf09ed011e18ce (diff)
downloadgitlab-ce-10e18de60f55811137871acefd331d2d5a41f237.tar.gz
Add latest changes from gitlab-org/gitlab@13-12-stable-ee
Diffstat (limited to 'spec/controllers/projects_controller_spec.rb')
-rw-r--r--spec/controllers/projects_controller_spec.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/controllers/projects_controller_spec.rb b/spec/controllers/projects_controller_spec.rb
index ffe2d393b1e..fdc687496b7 100644
--- a/spec/controllers/projects_controller_spec.rb
+++ b/spec/controllers/projects_controller_spec.rb
@@ -375,6 +375,23 @@ RSpec.describe ProjectsController do
end
end
+ context 'when project is moved and git format is requested' do
+ let(:old_path) { project.path + 'old' }
+
+ before do
+ project.redirect_routes.create!(path: "#{project.namespace.full_path}/#{old_path}")
+
+ project.add_developer(user)
+ sign_in(user)
+ end
+
+ it 'redirects to new project path' do
+ get :show, params: { namespace_id: project.namespace, id: old_path }, format: :git
+
+ expect(response).to redirect_to(project_path(project, format: :git))
+ end
+ end
+
context 'when the project is forked and has a repository', :request_store do
let(:public_project) { create(:project, :public, :repository) }
let(:other_user) { create(:user) }