Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/controllers/projects/issues_controller_spec.rb')
-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