summaryrefslogtreecommitdiff
path: root/spec/controllers
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-09-16 09:06:25 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-09-16 09:06:25 +0000
commitd8211a0ed119eada7d292e974a8fc7b0cd982d3c (patch)
treea14bfca83dd6b71144959d7e7a6d058f5d8922a5 /spec/controllers
parentedd042071d1b5e6f494881dc2d9c39b46e42f74b (diff)
downloadgitlab-ce-d8211a0ed119eada7d292e974a8fc7b0cd982d3c.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/controllers')
-rw-r--r--spec/controllers/projects/issues_controller_spec.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/spec/controllers/projects/issues_controller_spec.rb b/spec/controllers/projects/issues_controller_spec.rb
index 367bd641f5d..397ac59546f 100644
--- a/spec/controllers/projects/issues_controller_spec.rb
+++ b/spec/controllers/projects/issues_controller_spec.rb
@@ -36,6 +36,31 @@ describe Projects::IssuesController do
expect(response).to render_template(:index)
end
end
+
+ context 'when project has moved' do
+ let(:new_project) { create(:project) }
+ let(:issue) { create(:issue, project: new_project) }
+
+ before do
+ project.route.destroy
+ new_project.redirect_routes.create!(path: project.full_path)
+ new_project.add_developer(user)
+ end
+
+ it 'redirects to the new issue tracker from the old one' do
+ get :index, params: { namespace_id: project.namespace, project_id: project }
+
+ expect(response).to redirect_to(project_issues_path(new_project))
+ expect(response).to have_gitlab_http_status(302)
+ end
+
+ it 'redirects from an old issue correctly' do
+ get :show, params: { namespace_id: project.namespace, project_id: project, id: issue }
+
+ expect(response).to redirect_to(project_issue_path(new_project, issue))
+ expect(response).to have_gitlab_http_status(302)
+ end
+ end
end
context 'internal issue tracker' do