summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2019-08-05 08:37:32 +0000
committerRémy Coutable <remy@rymai.me>2019-08-05 08:37:32 +0000
commit1ca5e1186d4bfeaa61b065f23419e640e4e52af3 (patch)
tree16385bcdcb4b6d755d0175ee7467c344c3665909
parent523e00abd74a9067fb17129faa1d35bfa107e04a (diff)
parent6ba99cf8b5cc37184812ec98af4fc37a026da2f8 (diff)
downloadgitlab-ce-1ca5e1186d4bfeaa61b065f23419e640e4e52af3.tar.gz
Merge branch 'fix-design-management-router-ce' into 'master'
CE Backport for gitlab-ee!14741 (Fix design management router) See merge request gitlab-org/gitlab-ce!31090
-rw-r--r--config/routes/project.rb4
-rw-r--r--spec/controllers/projects/issues_controller_spec.rb21
2 files changed, 11 insertions, 14 deletions
diff --git a/config/routes/project.rb b/config/routes/project.rb
index 1f632765317..3113cb172f7 100644
--- a/config/routes/project.rb
+++ b/config/routes/project.rb
@@ -500,6 +500,10 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
get :realtime_changes
post :create_merge_request
get :discussions, format: :json
+
+ Gitlab.ee do
+ get 'designs(/*vueroute)', to: 'issues#show', format: false
+ end
end
collection do
diff --git a/spec/controllers/projects/issues_controller_spec.rb b/spec/controllers/projects/issues_controller_spec.rb
index 0f885d776e1..fab47aa4701 100644
--- a/spec/controllers/projects/issues_controller_spec.rb
+++ b/spec/controllers/projects/issues_controller_spec.rb
@@ -251,15 +251,13 @@ describe Projects::IssuesController do
end
end
- describe 'Redirect after sign in' do
+ # This spec runs as a request-style spec in order to invoke the
+ # Rails router. A controller-style spec matches the wrong route, and
+ # session['user_return_to'] becomes incorrect.
+ describe 'Redirect after sign in', type: :request do
context 'with an AJAX request' do
it 'does not store the visited URL' do
- get :show, params: {
- format: :json,
- namespace_id: project.namespace,
- project_id: project,
- id: issue.iid
- }, xhr: true
+ get project_issue_path(project, issue), xhr: true
expect(session['user_return_to']).to be_blank
end
@@ -267,14 +265,9 @@ describe Projects::IssuesController do
context 'without an AJAX request' do
it 'stores the visited URL' do
- get :show,
- params: {
- namespace_id: project.namespace.to_param,
- project_id: project,
- id: issue.iid
- }
+ get project_issue_path(project, issue)
- expect(session['user_return_to']).to eq("/#{project.namespace.to_param}/#{project.to_param}/issues/#{issue.iid}")
+ expect(session['user_return_to']).to eq(project_issue_path(project, issue))
end
end
end