summaryrefslogtreecommitdiff
path: root/spec/controllers/groups
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-10-26 06:06:35 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-10-26 06:06:35 +0000
commit71c6369c63c3b0576c79f2c9b4ba977aded8de7a (patch)
tree591bacb9183098ed90a2afabccd517f9b79b9d87 /spec/controllers/groups
parent693cbd0f88c279cf1dbf4997dd8914c720cdd32c (diff)
downloadgitlab-ce-71c6369c63c3b0576c79f2c9b4ba977aded8de7a.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/controllers/groups')
-rw-r--r--spec/controllers/groups/milestones_controller_spec.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/controllers/groups/milestones_controller_spec.rb b/spec/controllers/groups/milestones_controller_spec.rb
index e0a3605d50a..4f4f9e5143b 100644
--- a/spec/controllers/groups/milestones_controller_spec.rb
+++ b/spec/controllers/groups/milestones_controller_spec.rb
@@ -314,6 +314,24 @@ describe Groups::MilestonesController do
expect(controller).to set_flash[:notice].to(group_moved_message(redirect_route, group))
end
+ context 'with an AJAX request' do
+ it 'redirects to the canonical path but does not set flash message' do
+ get :merge_requests, params: { group_id: redirect_route.path, id: title }, xhr: true
+
+ expect(response).to redirect_to(merge_requests_group_milestone_path(group.to_param, title))
+ expect(controller).not_to set_flash[:notice]
+ end
+ end
+
+ context 'with JSON format' do
+ it 'redirects to the canonical path but does not set flash message' do
+ get :merge_requests, params: { group_id: redirect_route.path, id: title }, format: :json
+
+ expect(response).to redirect_to(merge_requests_group_milestone_path(group.to_param, title, format: :json))
+ expect(controller).not_to set_flash[:notice]
+ end
+ end
+
context 'when the old group path is a substring of the scheme or host' do
let(:redirect_route) { group.redirect_routes.create(path: 'http') }