Commit 1578bae2 authored by Robert Speicher's avatar Robert Speicher

Merge branch 'dz-move-project-routes' into 'master'

Move merge request routes under /-/ scope

See merge request gitlab-org/gitlab!21126
parents 849b2c77 e700c232
...@@ -162,7 +162,7 @@ export const createCommitPayload = ({ ...@@ -162,7 +162,7 @@ export const createCommitPayload = ({
}); });
export const createNewMergeRequestUrl = (projectUrl, source, target) => export const createNewMergeRequestUrl = (projectUrl, source, target) =>
`${projectUrl}/merge_requests/new?merge_request[source_branch]=${source}&merge_request[target_branch]=${target}&nav_source=webide`; `${projectUrl}/-/merge_requests/new?merge_request[source_branch]=${source}&merge_request[target_branch]=${target}&nav_source=webide`;
const sortTreesByTypeAndName = (a, b) => { const sortTreesByTypeAndName = (a, b) => {
if (a.type === 'tree' && b.type === 'blob') { if (a.type === 'tree' && b.type === 'blob') {
......
...@@ -32,17 +32,17 @@ import { __ } from './locale'; ...@@ -32,17 +32,17 @@ import { __ } from './locale';
// //
// <ul class="nav-links merge-request-tabs"> // <ul class="nav-links merge-request-tabs">
// <li class="notes-tab active"> // <li class="notes-tab active">
// <a data-action="notes" data-target="#notes" data-toggle="tab" href="/foo/bar/merge_requests/1"> // <a data-action="notes" data-target="#notes" data-toggle="tab" href="/foo/bar/-/merge_requests/1">
// Discussion // Discussion
// </a> // </a>
// </li> // </li>
// <li class="commits-tab"> // <li class="commits-tab">
// <a data-action="commits" data-target="#commits" data-toggle="tab" href="/foo/bar/merge_requests/1/commits"> // <a data-action="commits" data-target="#commits" data-toggle="tab" href="/foo/bar/-/merge_requests/1/commits">
// Commits // Commits
// </a> // </a>
// </li> // </li>
// <li class="diffs-tab"> // <li class="diffs-tab">
// <a data-action="diffs" data-target="#diffs" data-toggle="tab" href="/foo/bar/merge_requests/1/diffs"> // <a data-action="diffs" data-target="#diffs" data-toggle="tab" href="/foo/bar/-/merge_requests/1/diffs">
// Diffs // Diffs
// </a> // </a>
// </li> // </li>
...@@ -260,17 +260,17 @@ export default class MergeRequestTabs { ...@@ -260,17 +260,17 @@ export default class MergeRequestTabs {
// //
// Examples: // Examples:
// //
// location.pathname # => "/namespace/project/merge_requests/1" // location.pathname # => "/namespace/project/-/merge_requests/1"
// setCurrentAction('diffs') // setCurrentAction('diffs')
// location.pathname # => "/namespace/project/merge_requests/1/diffs" // location.pathname # => "/namespace/project/-/merge_requests/1/diffs"
// //
// location.pathname # => "/namespace/project/merge_requests/1/diffs" // location.pathname # => "/namespace/project/-/merge_requests/1/diffs"
// setCurrentAction('show') // setCurrentAction('show')
// location.pathname # => "/namespace/project/merge_requests/1" // location.pathname # => "/namespace/project/-/merge_requests/1"
// //
// location.pathname # => "/namespace/project/merge_requests/1/diffs" // location.pathname # => "/namespace/project/-/merge_requests/1/diffs"
// setCurrentAction('commits') // setCurrentAction('commits')
// location.pathname # => "/namespace/project/merge_requests/1/commits" // location.pathname # => "/namespace/project/-/merge_requests/1/commits"
// //
// Returns the new URL String // Returns the new URL String
setCurrentAction(action) { setCurrentAction(action) {
......
...@@ -62,7 +62,7 @@ module ChatMessage ...@@ -62,7 +62,7 @@ module ChatMessage
end end
def merge_request_url def merge_request_url
"#{project_url}/merge_requests/#{merge_request_iid}" "#{project_url}/-/merge_requests/#{merge_request_iid}"
end end
# overridden in EE # overridden in EE
......
...@@ -184,7 +184,7 @@ class HipchatService < Service ...@@ -184,7 +184,7 @@ class HipchatService < Service
description = obj_attr[:description] description = obj_attr[:description]
title = render_line(obj_attr[:title]) title = render_line(obj_attr[:title])
merge_request_url = "#{project_url}/merge_requests/#{merge_request_id}" merge_request_url = "#{project_url}/-/merge_requests/#{merge_request_id}"
merge_request_link = "<a href=\"#{merge_request_url}\">merge request !#{merge_request_id}</a>" merge_request_link = "<a href=\"#{merge_request_url}\">merge request !#{merge_request_id}</a>"
message = ["#{user_name} #{state} #{merge_request_link} in " \ message = ["#{user_name} #{state} #{merge_request_link} in " \
"#{project_link}: <b>#{title}</b>"] "#{project_link}: <b>#{title}</b>"]
......
---
title: Move merge request routes under /-/ scope
merge_request: 21126
author:
type: deprecated
...@@ -260,63 +260,6 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do ...@@ -260,63 +260,6 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
end end
end end
# The wiki routing contains wildcard characters so
# its preferable to keep it below all other project routes
draw :wiki
end
# End of the /-/ scope.
# All new routes should go under /-/ scope.
# Look for scope '-' at the top of the file.
# rubocop: disable Cop/PutProjectRoutesUnderScope
#
# Templates
#
get '/templates/:template_type/:key' => 'templates#show',
as: :template,
defaults: { format: 'json' },
constraints: { key: %r{[^/]+}, template_type: %r{issue|merge_request}, format: 'json' }
get '/description_templates/names/:template_type',
to: 'templates#names',
as: :template_names,
defaults: { format: 'json' },
constraints: { template_type: %r{issue|merge_request}, format: 'json' }
resources :commit, only: [:show], constraints: { id: /\h{7,40}/ } do
member do
get :branches
get :pipelines
post :revert
post :cherry_pick
get :diff_for_path
get :merge_requests
end
end
resource :pages, only: [:show, :update, :destroy] do
resources :domains, except: :index, controller: 'pages_domains', constraints: { id: %r{[^/]+} } do
member do
post :verify
delete :clean_certificate
end
end
end
resources :snippets, concerns: :awardable, constraints: { id: /\d+/ } do
member do
get :raw
post :mark_as_spam
end
end
namespace :prometheus do
resources :metrics, constraints: { id: %r{[^\/]+} }, only: [:index, :new, :create, :edit, :update, :destroy] do
get :active_common, on: :collection
end
end
resources :merge_requests, concerns: :awardable, except: [:new, :create, :show], constraints: { id: /\d+/ } do resources :merge_requests, concerns: :awardable, except: [:new, :create, :show], constraints: { id: /\d+/ } do
member do member do
get :show # Insert this first to ensure redirections using merge_requests#show match this route get :show # Insert this first to ensure redirections using merge_requests#show match this route
...@@ -393,6 +336,63 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do ...@@ -393,6 +336,63 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
end end
end end
# The wiki routing contains wildcard characters so
# its preferable to keep it below all other project routes
draw :wiki
end
# End of the /-/ scope.
# All new routes should go under /-/ scope.
# Look for scope '-' at the top of the file.
# rubocop: disable Cop/PutProjectRoutesUnderScope
#
# Templates
#
get '/templates/:template_type/:key' => 'templates#show',
as: :template,
defaults: { format: 'json' },
constraints: { key: %r{[^/]+}, template_type: %r{issue|merge_request}, format: 'json' }
get '/description_templates/names/:template_type',
to: 'templates#names',
as: :template_names,
defaults: { format: 'json' },
constraints: { template_type: %r{issue|merge_request}, format: 'json' }
resources :commit, only: [:show], constraints: { id: /\h{7,40}/ } do
member do
get :branches
get :pipelines
post :revert
post :cherry_pick
get :diff_for_path
get :merge_requests
end
end
resource :pages, only: [:show, :update, :destroy] do
resources :domains, except: :index, controller: 'pages_domains', constraints: { id: %r{[^/]+} } do
member do
post :verify
delete :clean_certificate
end
end
end
resources :snippets, concerns: :awardable, constraints: { id: /\d+/ } do
member do
get :raw
post :mark_as_spam
end
end
namespace :prometheus do
resources :metrics, constraints: { id: %r{[^\/]+} }, only: [:index, :new, :create, :edit, :update, :destroy] do
get :active_common, on: :collection
end
end
resources :pipelines, only: [:index, :new, :create, :show] do resources :pipelines, only: [:index, :new, :create, :show] do
collection do collection do
resource :pipelines_settings, path: 'settings', only: [:show, :update] resource :pipelines_settings, path: 'settings', only: [:show, :update]
...@@ -546,7 +546,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do ...@@ -546,7 +546,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
:forks, :group_links, :import, :avatar, :mirror, :forks, :group_links, :import, :avatar, :mirror,
:cycle_analytics, :mattermost, :variables, :triggers, :cycle_analytics, :mattermost, :variables, :triggers,
:environments, :protected_environments, :error_tracking, :environments, :protected_environments, :error_tracking,
:serverless, :clusters, :audit_events, :wikis) :serverless, :clusters, :audit_events, :wikis, :merge_requests)
end end
# rubocop: disable Cop/PutProjectRoutesUnderScope # rubocop: disable Cop/PutProjectRoutesUnderScope
......
...@@ -253,7 +253,7 @@ const GUIDED_GITLAB_TOUR = [ ...@@ -253,7 +253,7 @@ const GUIDED_GITLAB_TOUR = [
}, },
}, },
{ {
forUrl: ({ projectFullPath }) => new RegExp(`${projectFullPath}/merge_requests$`, ''), forUrl: ({ projectFullPath }) => new RegExp(`${projectFullPath}/-/merge_requests$`, ''),
getHelpContent: () => [ getHelpContent: () => [
{ {
text: s__( text: s__(
...@@ -270,7 +270,7 @@ const GUIDED_GITLAB_TOUR = [ ...@@ -270,7 +270,7 @@ const GUIDED_GITLAB_TOUR = [
}, },
}, },
{ {
forUrl: ({ projectFullPath }) => new RegExp(`${projectFullPath}/merge_requests/[0-9]+$`, ''), forUrl: ({ projectFullPath }) => new RegExp(`${projectFullPath}/-/merge_requests/[0-9]+$`, ''),
getHelpContent: () => [ getHelpContent: () => [
{ {
text: sprintf( text: sprintf(
......
...@@ -82,6 +82,37 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do ...@@ -82,6 +82,37 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
end end
resources :audit_events, only: [:index] resources :audit_events, only: [:index]
resources :merge_requests, only: [], constraints: { id: /\d+/ } do
member do
get '/descriptions/:version_id/diff', action: :description_diff, as: :description_diff
get :metrics_reports
get :license_management_reports
get :container_scanning_reports
get :dependency_scanning_reports
get :sast_reports
get :dast_reports
get :approvals
post :approvals, action: :approve
delete :approvals, action: :unapprove
post :rebase
end
resources :approvers, only: :destroy
delete 'approvers', to: 'approvers#destroy_via_user_id', as: :approver_via_user_id
resources :approver_groups, only: :destroy
scope module: :merge_requests do
resources :drafts, only: [:index, :update, :create, :destroy] do
collection do
post :publish
delete :discard
end
end
end
end
end end
# End of the /-/ scope. # End of the /-/ scope.
...@@ -137,37 +168,6 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do ...@@ -137,37 +168,6 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
get '/service_desk' => 'service_desk#show', as: :service_desk get '/service_desk' => 'service_desk#show', as: :service_desk
put '/service_desk' => 'service_desk#update', as: :service_desk_refresh put '/service_desk' => 'service_desk#update', as: :service_desk_refresh
resources :merge_requests, only: [], constraints: { id: /\d+/ } do
member do
get '/descriptions/:version_id/diff', action: :description_diff, as: :description_diff
get :metrics_reports
get :license_management_reports
get :container_scanning_reports
get :dependency_scanning_reports
get :sast_reports
get :dast_reports
get :approvals
post :approvals, action: :approve
delete :approvals, action: :unapprove
post :rebase
end
resources :approvers, only: :destroy
delete 'approvers', to: 'approvers#destroy_via_user_id', as: :approver_via_user_id
resources :approver_groups, only: :destroy
scope module: :merge_requests do
resources :drafts, only: [:index, :update, :create, :destroy] do
collection do
post :publish
delete :discard
end
end
end
end
resources :approvers, only: :destroy resources :approvers, only: :destroy
resources :approver_groups, only: :destroy resources :approver_groups, only: :destroy
resources :push_rules, constraints: { id: /\d+/ }, only: [:update] resources :push_rules, constraints: { id: /\d+/ }, only: [:update]
......
...@@ -31,7 +31,7 @@ describe('noteActions', () => { ...@@ -31,7 +31,7 @@ describe('noteActions', () => {
canReportAsAbuse: true, canReportAsAbuse: true,
canResolve: true, canResolve: true,
noteId: '539', noteId: '539',
noteUrl: `${TEST_HOST}/group/project/merge_requests/1#note_1`, noteUrl: `${TEST_HOST}/group/project/-/merge_requests/1#note_1`,
reportAbusePath: `${TEST_HOST}/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-foss%2Fissues%2F7%23note_539&user_id=26`, reportAbusePath: `${TEST_HOST}/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-foss%2Fissues%2F7%23note_539&user_id=26`,
showReply: false, showReply: false,
isDraft: true, isDraft: true,
......
...@@ -52,7 +52,7 @@ export const noteableDataMock = { ...@@ -52,7 +52,7 @@ export const noteableDataMock = {
time_estimate: 0, time_estimate: 0,
title: '14', title: '14',
total_time_spent: 0, total_time_spent: 0,
noteable_note_url: '/group/project/merge_requests/1#note_1', noteable_note_url: '/group/project/-/merge_requests/1#note_1',
updated_at: '2017-08-04T09:53:01.226Z', updated_at: '2017-08-04T09:53:01.226Z',
updated_by_id: 1, updated_by_id: 1,
web_url: '/gitlab-org/gitlab-foss/issues/26', web_url: '/gitlab-org/gitlab-foss/issues/26',
...@@ -101,8 +101,8 @@ export const individualNote = { ...@@ -101,8 +101,8 @@ export const individualNote = {
{ name: 'art', user: { id: 1, name: 'Root', username: 'root' } }, { name: 'art', user: { id: 1, name: 'Root', username: 'root' } },
], ],
toggle_award_path: '/gitlab-org/gitlab-foss/notes/1390/toggle_award_emoji', toggle_award_path: '/gitlab-org/gitlab-foss/notes/1390/toggle_award_emoji',
noteable_note_url: '/group/project/merge_requests/1#note_1', noteable_note_url: '/group/project/-/merge_requests/1#note_1',
note_url: '/group/project/merge_requests/1#note_1', note_url: '/group/project/-/merge_requests/1#note_1',
report_abuse_path: report_abuse_path:
'/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-foss%2Fissues%2F26%23note_1390&user_id=1', '/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-foss%2Fissues%2F26%23note_1390&user_id=1',
path: '/gitlab-org/gitlab-foss/notes/1390', path: '/gitlab-org/gitlab-foss/notes/1390',
...@@ -161,8 +161,8 @@ export const note = { ...@@ -161,8 +161,8 @@ export const note = {
}, },
], ],
toggle_award_path: '/gitlab-org/gitlab-foss/notes/546/toggle_award_emoji', toggle_award_path: '/gitlab-org/gitlab-foss/notes/546/toggle_award_emoji',
note_url: '/group/project/merge_requests/1#note_1', note_url: '/group/project/-/merge_requests/1#note_1',
noteable_note_url: '/group/project/merge_requests/1#note_1', noteable_note_url: '/group/project/-/merge_requests/1#note_1',
report_abuse_path: report_abuse_path:
'/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-foss%2Fissues%2F7%23note_546&user_id=1', '/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-foss%2Fissues%2F7%23note_546&user_id=1',
path: '/gitlab-org/gitlab-foss/notes/546', path: '/gitlab-org/gitlab-foss/notes/546',
...@@ -204,7 +204,7 @@ export const discussionMock = { ...@@ -204,7 +204,7 @@ export const discussionMock = {
discussion_id: '9e3bd2f71a01de45fd166e6719eb380ad9f270b1', discussion_id: '9e3bd2f71a01de45fd166e6719eb380ad9f270b1',
emoji_awardable: true, emoji_awardable: true,
award_emoji: [], award_emoji: [],
noteable_note_url: '/group/project/merge_requests/1#note_1', noteable_note_url: '/group/project/-/merge_requests/1#note_1',
toggle_award_path: '/gitlab-org/gitlab-foss/notes/1395/toggle_award_emoji', toggle_award_path: '/gitlab-org/gitlab-foss/notes/1395/toggle_award_emoji',
report_abuse_path: report_abuse_path:
'/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-foss%2Fissues%2F26%23note_1395&user_id=1', '/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-foss%2Fissues%2F26%23note_1395&user_id=1',
...@@ -251,7 +251,7 @@ export const discussionMock = { ...@@ -251,7 +251,7 @@ export const discussionMock = {
emoji_awardable: true, emoji_awardable: true,
award_emoji: [], award_emoji: [],
toggle_award_path: '/gitlab-org/gitlab-foss/notes/1396/toggle_award_emoji', toggle_award_path: '/gitlab-org/gitlab-foss/notes/1396/toggle_award_emoji',
noteable_note_url: '/group/project/merge_requests/1#note_1', noteable_note_url: '/group/project/-/merge_requests/1#note_1',
report_abuse_path: report_abuse_path:
'/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-foss%2Fissues%2F26%23note_1396&user_id=1', '/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-foss%2Fissues%2F26%23note_1396&user_id=1',
path: '/gitlab-org/gitlab-foss/notes/1396', path: '/gitlab-org/gitlab-foss/notes/1396',
...@@ -296,7 +296,7 @@ export const discussionMock = { ...@@ -296,7 +296,7 @@ export const discussionMock = {
discussion_id: '9e3bd2f71a01de45fd166e6719eb380ad9f270b1', discussion_id: '9e3bd2f71a01de45fd166e6719eb380ad9f270b1',
emoji_awardable: true, emoji_awardable: true,
award_emoji: [], award_emoji: [],
noteable_note_url: '/group/project/merge_requests/1#note_1', noteable_note_url: '/group/project/-/merge_requests/1#note_1',
toggle_award_path: '/gitlab-org/gitlab-foss/notes/1437/toggle_award_emoji', toggle_award_path: '/gitlab-org/gitlab-foss/notes/1437/toggle_award_emoji',
report_abuse_path: report_abuse_path:
'/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-foss%2Fissues%2F26%23note_1437&user_id=1', '/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-foss%2Fissues%2F26%23note_1437&user_id=1',
...@@ -346,7 +346,7 @@ export const loggedOutnoteableData = { ...@@ -346,7 +346,7 @@ export const loggedOutnoteableData = {
can_create_note: false, can_create_note: false,
can_update: false, can_update: false,
}, },
noteable_note_url: '/group/project/merge_requests/1#note_1', noteable_note_url: '/group/project/-/merge_requests/1#note_1',
create_note_path: '/gitlab-org/gitlab-foss/notes?target_id=98&target_type=issue', create_note_path: '/gitlab-org/gitlab-foss/notes?target_id=98&target_type=issue',
preview_note_path: '/gitlab-org/gitlab-foss/preview_markdown?target_id=98&target_type=Issue', preview_note_path: '/gitlab-org/gitlab-foss/preview_markdown?target_id=98&target_type=Issue',
}; };
...@@ -480,7 +480,7 @@ export const INDIVIDUAL_NOTE_RESPONSE_MAP = { ...@@ -480,7 +480,7 @@ export const INDIVIDUAL_NOTE_RESPONSE_MAP = {
}, },
}, },
], ],
noteable_note_url: '/group/project/merge_requests/1#note_1', noteable_note_url: '/group/project/-/merge_requests/1#note_1',
toggle_award_path: '/gitlab-org/gitlab-foss/notes/1390/toggle_award_emoji', toggle_award_path: '/gitlab-org/gitlab-foss/notes/1390/toggle_award_emoji',
report_abuse_path: report_abuse_path:
'/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-foss%2Fissues%2F26%23note_1390\u0026user_id=1', '/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-foss%2Fissues%2F26%23note_1390\u0026user_id=1',
...@@ -525,7 +525,7 @@ export const INDIVIDUAL_NOTE_RESPONSE_MAP = { ...@@ -525,7 +525,7 @@ export const INDIVIDUAL_NOTE_RESPONSE_MAP = {
discussion_id: '70d5c92a4039a36c70100c6691c18c27e4b0a790', discussion_id: '70d5c92a4039a36c70100c6691c18c27e4b0a790',
emoji_awardable: true, emoji_awardable: true,
award_emoji: [], award_emoji: [],
noteable_note_url: '/group/project/merge_requests/1#note_1', noteable_note_url: '/group/project/-/merge_requests/1#note_1',
toggle_award_path: '/gitlab-org/gitlab-foss/notes/1391/toggle_award_emoji', toggle_award_path: '/gitlab-org/gitlab-foss/notes/1391/toggle_award_emoji',
report_abuse_path: report_abuse_path:
'/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-foss%2Fissues%2F26%23note_1391\u0026user_id=1', '/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-foss%2Fissues%2F26%23note_1391\u0026user_id=1',
...@@ -580,7 +580,7 @@ export const INDIVIDUAL_NOTE_RESPONSE_MAP = { ...@@ -580,7 +580,7 @@ export const INDIVIDUAL_NOTE_RESPONSE_MAP = {
discussion_id: 'a3ed36e29b1957efb3b68c53e2d7a2b24b1df052', discussion_id: 'a3ed36e29b1957efb3b68c53e2d7a2b24b1df052',
emoji_awardable: true, emoji_awardable: true,
award_emoji: [], award_emoji: [],
noteable_note_url: '/group/project/merge_requests/1#note_1', noteable_note_url: '/group/project/-/merge_requests/1#note_1',
toggle_award_path: '/gitlab-org/gitlab-foss/notes/1471/toggle_award_emoji', toggle_award_path: '/gitlab-org/gitlab-foss/notes/1471/toggle_award_emoji',
report_abuse_path: report_abuse_path:
'/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-foss%2Fissues%2F29%23note_1471\u0026user_id=1', '/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-foss%2Fissues%2F29%23note_1471\u0026user_id=1',
...@@ -632,7 +632,7 @@ export const DISCUSSION_NOTE_RESPONSE_MAP = { ...@@ -632,7 +632,7 @@ export const DISCUSSION_NOTE_RESPONSE_MAP = {
emoji_awardable: true, emoji_awardable: true,
award_emoji: [], award_emoji: [],
toggle_award_path: '/gitlab-org/gitlab-foss/notes/1471/toggle_award_emoji', toggle_award_path: '/gitlab-org/gitlab-foss/notes/1471/toggle_award_emoji',
noteable_note_url: '/group/project/merge_requests/1#note_1', noteable_note_url: '/group/project/-/merge_requests/1#note_1',
report_abuse_path: report_abuse_path:
'/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-foss%2Fissues%2F29%23note_1471\u0026user_id=1', '/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-foss%2Fissues%2F29%23note_1471\u0026user_id=1',
path: '/gitlab-org/gitlab-foss/notes/1471', path: '/gitlab-org/gitlab-foss/notes/1471',
......
...@@ -36,7 +36,7 @@ RSpec.describe ChatMessage::MergeMessage do ...@@ -36,7 +36,7 @@ RSpec.describe ChatMessage::MergeMessage do
it 'returns a message regarding completed approval of merge requests' do it 'returns a message regarding completed approval of merge requests' do
expect(subject.pretext).to eq( expect(subject.pretext).to eq(
'Test User (test.user) approved <http://somewhere.com/merge_requests/100|!100 *Merge Request title*> '\ 'Test User (test.user) approved <http://somewhere.com/-/merge_requests/100|!100 *Merge Request title*> '\
'in <http://somewhere.com|project_name>') 'in <http://somewhere.com|project_name>')
expect(subject.attachments).to be_empty expect(subject.attachments).to be_empty
end end
...@@ -49,7 +49,7 @@ RSpec.describe ChatMessage::MergeMessage do ...@@ -49,7 +49,7 @@ RSpec.describe ChatMessage::MergeMessage do
it 'returns a message regarding revocation of completed approval of merge requests' do it 'returns a message regarding revocation of completed approval of merge requests' do
expect(subject.pretext).to eq( expect(subject.pretext).to eq(
'Test User (test.user) unapproved <http://somewhere.com/merge_requests/100|!100 *Merge Request title*> '\ 'Test User (test.user) unapproved <http://somewhere.com/-/merge_requests/100|!100 *Merge Request title*> '\
'in <http://somewhere.com|project_name>') 'in <http://somewhere.com|project_name>')
expect(subject.attachments).to be_empty expect(subject.attachments).to be_empty
end end
...@@ -62,7 +62,7 @@ RSpec.describe ChatMessage::MergeMessage do ...@@ -62,7 +62,7 @@ RSpec.describe ChatMessage::MergeMessage do
it 'returns a message regarding added approval of merge requests' do it 'returns a message regarding added approval of merge requests' do
expect(subject.pretext).to eq( expect(subject.pretext).to eq(
'Test User (test.user) added their approval to <http://somewhere.com/merge_requests/100|!100 *Merge Request title*> '\ 'Test User (test.user) added their approval to <http://somewhere.com/-/merge_requests/100|!100 *Merge Request title*> '\
'in <http://somewhere.com|project_name>') 'in <http://somewhere.com|project_name>')
expect(subject.attachments).to be_empty expect(subject.attachments).to be_empty
end end
...@@ -75,7 +75,7 @@ RSpec.describe ChatMessage::MergeMessage do ...@@ -75,7 +75,7 @@ RSpec.describe ChatMessage::MergeMessage do
it 'returns a message regarding revoking approval of merge requests' do it 'returns a message regarding revoking approval of merge requests' do
expect(subject.pretext).to eq( expect(subject.pretext).to eq(
'Test User (test.user) removed their approval from <http://somewhere.com/merge_requests/100|!100 *Merge Request title*> '\ 'Test User (test.user) removed their approval from <http://somewhere.com/-/merge_requests/100|!100 *Merge Request title*> '\
'in <http://somewhere.com|project_name>') 'in <http://somewhere.com|project_name>')
expect(subject.attachments).to be_empty expect(subject.attachments).to be_empty
end end
......
...@@ -36,7 +36,7 @@ describe MergeRequestPresenter do ...@@ -36,7 +36,7 @@ describe MergeRequestPresenter do
it_behaves_like 'is nil when needed' it_behaves_like 'is nil when needed'
it { is_expected.to eq(expose_path("/#{merge_request.project.full_path}/merge_requests/#{merge_request.iid}/approvals")) } it { is_expected.to eq(expose_path("/#{merge_request.project.full_path}/-/merge_requests/#{merge_request.iid}/approvals")) }
end end
describe '#api_approvals_path' do describe '#api_approvals_path' do
......
...@@ -52,7 +52,7 @@ export const noteableDataMock = { ...@@ -52,7 +52,7 @@ export const noteableDataMock = {
time_estimate: 0, time_estimate: 0,
title: '14', title: '14',
total_time_spent: 0, total_time_spent: 0,
noteable_note_url: '/group/project/merge_requests/1#note_1', noteable_note_url: '/group/project/-/merge_requests/1#note_1',
updated_at: '2017-08-04T09:53:01.226Z', updated_at: '2017-08-04T09:53:01.226Z',
updated_by_id: 1, updated_by_id: 1,
web_url: '/gitlab-org/gitlab-foss/issues/26', web_url: '/gitlab-org/gitlab-foss/issues/26',
...@@ -101,8 +101,8 @@ export const individualNote = { ...@@ -101,8 +101,8 @@ export const individualNote = {
{ name: 'art', user: { id: 1, name: 'Root', username: 'root' } }, { name: 'art', user: { id: 1, name: 'Root', username: 'root' } },
], ],
toggle_award_path: '/gitlab-org/gitlab-foss/notes/1390/toggle_award_emoji', toggle_award_path: '/gitlab-org/gitlab-foss/notes/1390/toggle_award_emoji',
noteable_note_url: '/group/project/merge_requests/1#note_1', noteable_note_url: '/group/project/-/merge_requests/1#note_1',
note_url: '/group/project/merge_requests/1#note_1', note_url: '/group/project/-/merge_requests/1#note_1',
report_abuse_path: report_abuse_path:
'/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-ce%2Fissues%2F26%23note_1390&user_id=1', '/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-ce%2Fissues%2F26%23note_1390&user_id=1',
path: '/gitlab-org/gitlab-foss/notes/1390', path: '/gitlab-org/gitlab-foss/notes/1390',
...@@ -161,8 +161,8 @@ export const note = { ...@@ -161,8 +161,8 @@ export const note = {
}, },
], ],
toggle_award_path: '/gitlab-org/gitlab-foss/notes/546/toggle_award_emoji', toggle_award_path: '/gitlab-org/gitlab-foss/notes/546/toggle_award_emoji',
note_url: '/group/project/merge_requests/1#note_1', note_url: '/group/project/-/merge_requests/1#note_1',
noteable_note_url: '/group/project/merge_requests/1#note_1', noteable_note_url: '/group/project/-/merge_requests/1#note_1',
report_abuse_path: report_abuse_path:
'/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-ce%2Fissues%2F7%23note_546&user_id=1', '/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-ce%2Fissues%2F7%23note_546&user_id=1',
path: '/gitlab-org/gitlab-foss/notes/546', path: '/gitlab-org/gitlab-foss/notes/546',
...@@ -205,7 +205,7 @@ export const discussionMock = { ...@@ -205,7 +205,7 @@ export const discussionMock = {
discussion_id: '9e3bd2f71a01de45fd166e6719eb380ad9f270b1', discussion_id: '9e3bd2f71a01de45fd166e6719eb380ad9f270b1',
emoji_awardable: true, emoji_awardable: true,
award_emoji: [], award_emoji: [],
noteable_note_url: '/group/project/merge_requests/1#note_1', noteable_note_url: '/group/project/-/merge_requests/1#note_1',
toggle_award_path: '/gitlab-org/gitlab-foss/notes/1395/toggle_award_emoji', toggle_award_path: '/gitlab-org/gitlab-foss/notes/1395/toggle_award_emoji',
report_abuse_path: report_abuse_path:
'/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-ce%2Fissues%2F26%23note_1395&user_id=1', '/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-ce%2Fissues%2F26%23note_1395&user_id=1',
...@@ -253,7 +253,7 @@ export const discussionMock = { ...@@ -253,7 +253,7 @@ export const discussionMock = {
emoji_awardable: true, emoji_awardable: true,
award_emoji: [], award_emoji: [],
toggle_award_path: '/gitlab-org/gitlab-foss/notes/1396/toggle_award_emoji', toggle_award_path: '/gitlab-org/gitlab-foss/notes/1396/toggle_award_emoji',
noteable_note_url: '/group/project/merge_requests/1#note_1', noteable_note_url: '/group/project/-/merge_requests/1#note_1',
report_abuse_path: report_abuse_path:
'/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-ce%2Fissues%2F26%23note_1396&user_id=1', '/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-ce%2Fissues%2F26%23note_1396&user_id=1',
path: '/gitlab-org/gitlab-foss/notes/1396', path: '/gitlab-org/gitlab-foss/notes/1396',
...@@ -299,7 +299,7 @@ export const discussionMock = { ...@@ -299,7 +299,7 @@ export const discussionMock = {
discussion_id: '9e3bd2f71a01de45fd166e6719eb380ad9f270b1', discussion_id: '9e3bd2f71a01de45fd166e6719eb380ad9f270b1',
emoji_awardable: true, emoji_awardable: true,
award_emoji: [], award_emoji: [],
noteable_note_url: '/group/project/merge_requests/1#note_1', noteable_note_url: '/group/project/-/merge_requests/1#note_1',
toggle_award_path: '/gitlab-org/gitlab-foss/notes/1437/toggle_award_emoji', toggle_award_path: '/gitlab-org/gitlab-foss/notes/1437/toggle_award_emoji',
report_abuse_path: report_abuse_path:
'/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-ce%2Fissues%2F26%23note_1437&user_id=1', '/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-ce%2Fissues%2F26%23note_1437&user_id=1',
...@@ -349,7 +349,7 @@ export const loggedOutnoteableData = { ...@@ -349,7 +349,7 @@ export const loggedOutnoteableData = {
can_create_note: false, can_create_note: false,
can_update: false, can_update: false,
}, },
noteable_note_url: '/group/project/merge_requests/1#note_1', noteable_note_url: '/group/project/-/merge_requests/1#note_1',
create_note_path: '/gitlab-org/gitlab-foss/notes?target_id=98&target_type=issue', create_note_path: '/gitlab-org/gitlab-foss/notes?target_id=98&target_type=issue',
preview_note_path: '/gitlab-org/gitlab-foss/preview_markdown?target_id=98&target_type=Issue', preview_note_path: '/gitlab-org/gitlab-foss/preview_markdown?target_id=98&target_type=Issue',
}; };
...@@ -483,7 +483,7 @@ export const INDIVIDUAL_NOTE_RESPONSE_MAP = { ...@@ -483,7 +483,7 @@ export const INDIVIDUAL_NOTE_RESPONSE_MAP = {
}, },
}, },
], ],
noteable_note_url: '/group/project/merge_requests/1#note_1', noteable_note_url: '/group/project/-/merge_requests/1#note_1',
toggle_award_path: '/gitlab-org/gitlab-foss/notes/1390/toggle_award_emoji', toggle_award_path: '/gitlab-org/gitlab-foss/notes/1390/toggle_award_emoji',
report_abuse_path: report_abuse_path:
'/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-ce%2Fissues%2F26%23note_1390\u0026user_id=1', '/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-ce%2Fissues%2F26%23note_1390\u0026user_id=1',
...@@ -528,7 +528,7 @@ export const INDIVIDUAL_NOTE_RESPONSE_MAP = { ...@@ -528,7 +528,7 @@ export const INDIVIDUAL_NOTE_RESPONSE_MAP = {
discussion_id: '70d5c92a4039a36c70100c6691c18c27e4b0a790', discussion_id: '70d5c92a4039a36c70100c6691c18c27e4b0a790',
emoji_awardable: true, emoji_awardable: true,
award_emoji: [], award_emoji: [],
noteable_note_url: '/group/project/merge_requests/1#note_1', noteable_note_url: '/group/project/-/merge_requests/1#note_1',
toggle_award_path: '/gitlab-org/gitlab-foss/notes/1391/toggle_award_emoji', toggle_award_path: '/gitlab-org/gitlab-foss/notes/1391/toggle_award_emoji',
report_abuse_path: report_abuse_path:
'/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-ce%2Fissues%2F26%23note_1391\u0026user_id=1', '/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-ce%2Fissues%2F26%23note_1391\u0026user_id=1',
...@@ -583,7 +583,7 @@ export const INDIVIDUAL_NOTE_RESPONSE_MAP = { ...@@ -583,7 +583,7 @@ export const INDIVIDUAL_NOTE_RESPONSE_MAP = {
discussion_id: 'a3ed36e29b1957efb3b68c53e2d7a2b24b1df052', discussion_id: 'a3ed36e29b1957efb3b68c53e2d7a2b24b1df052',
emoji_awardable: true, emoji_awardable: true,
award_emoji: [], award_emoji: [],
noteable_note_url: '/group/project/merge_requests/1#note_1', noteable_note_url: '/group/project/-/merge_requests/1#note_1',
toggle_award_path: '/gitlab-org/gitlab-foss/notes/1471/toggle_award_emoji', toggle_award_path: '/gitlab-org/gitlab-foss/notes/1471/toggle_award_emoji',
report_abuse_path: report_abuse_path:
'/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-ce%2Fissues%2F29%23note_1471\u0026user_id=1', '/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-ce%2Fissues%2F29%23note_1471\u0026user_id=1',
...@@ -635,7 +635,7 @@ export const DISCUSSION_NOTE_RESPONSE_MAP = { ...@@ -635,7 +635,7 @@ export const DISCUSSION_NOTE_RESPONSE_MAP = {
emoji_awardable: true, emoji_awardable: true,
award_emoji: [], award_emoji: [],
toggle_award_path: '/gitlab-org/gitlab-foss/notes/1471/toggle_award_emoji', toggle_award_path: '/gitlab-org/gitlab-foss/notes/1471/toggle_award_emoji',
noteable_note_url: '/group/project/merge_requests/1#note_1', noteable_note_url: '/group/project/-/merge_requests/1#note_1',
report_abuse_path: report_abuse_path:
'/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-ce%2Fissues%2F29%23note_1471\u0026user_id=1', '/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-ce%2Fissues%2F29%23note_1471\u0026user_id=1',
path: '/gitlab-org/gitlab-foss/notes/1471', path: '/gitlab-org/gitlab-foss/notes/1471',
......
...@@ -51,7 +51,7 @@ describe AwardEmojiHelper do ...@@ -51,7 +51,7 @@ describe AwardEmojiHelper do
it 'returns correct url' do it 'returns correct url' do
@project = merge_request.project @project = merge_request.project
expected_url = "/#{@project.namespace.path}/#{@project.path}/merge_requests/#{merge_request.iid}/toggle_award_emoji" expected_url = "/#{@project.namespace.path}/#{@project.path}/-/merge_requests/#{merge_request.iid}/toggle_award_emoji"
expect(subject).to eq(expected_url) expect(subject).to eq(expected_url)
end end
......
...@@ -115,7 +115,7 @@ describe EventsHelper do ...@@ -115,7 +115,7 @@ describe EventsHelper do
it 'returns a merge request url' do it 'returns a merge request url' do
event.target = create(:note_on_merge_request, note: 'LGTM!') event.target = create(:note_on_merge_request, note: 'LGTM!')
expect(subject).to eq("#{project_base_url}/merge_requests/#{event.note_target.iid}#note_#{event.target.id}") expect(subject).to eq("#{project_base_url}/-/merge_requests/#{event.note_target.iid}#note_#{event.target.id}")
end end
end end
end end
...@@ -78,13 +78,21 @@ describe LabelsHelper do ...@@ -78,13 +78,21 @@ describe LabelsHelper do
end end
context 'with a type argument' do context 'with a type argument' do
['issue', :issue, 'merge_request', :merge_request].each do |type| ['issue', :issue].each do |type|
context "set to #{type}" do context "set to #{type}" do
it 'links to correct page' do it 'links to correct page' do
expect(link_to_label(label_presenter, type: type)).to match %r{<a href="/#{label.project.full_path}/#{type.to_s.pluralize}\?label_name%5B%5D=#{label.name}">.*</a>} expect(link_to_label(label_presenter, type: type)).to match %r{<a href="/#{label.project.full_path}/#{type.to_s.pluralize}\?label_name%5B%5D=#{label.name}">.*</a>}
end end
end end
end end
['merge_request', :merge_request].each do |type|
context "set to #{type}" do
it 'links to correct page' do
expect(link_to_label(label_presenter, type: type)).to match %r{<a href="/#{label.project.full_path}/-/#{type.to_s.pluralize}\?label_name%5B%5D=#{label.name}">.*</a>}
end
end
end
end end
context 'with a tooltip argument' do context 'with a tooltip argument' do
......
...@@ -461,7 +461,7 @@ describe('IDE commit module actions', () => { ...@@ -461,7 +461,7 @@ describe('IDE commit module actions', () => {
.dispatch('commit/commitChanges') .dispatch('commit/commitChanges')
.then(() => { .then(() => {
expect(visitUrl).toHaveBeenCalledWith( expect(visitUrl).toHaveBeenCalledWith(
`webUrl/merge_requests/new?merge_request[source_branch]=${ `webUrl/-/merge_requests/new?merge_request[source_branch]=${
store.getters['commit/placeholderBranchName'] store.getters['commit/placeholderBranchName']
}&merge_request[target_branch]=master&nav_source=webide`, }&merge_request[target_branch]=master&nav_source=webide`,
); );
......
...@@ -27,7 +27,7 @@ describe('Stages Dropdown', () => { ...@@ -27,7 +27,7 @@ describe('Stages Dropdown', () => {
}, },
merge_request: { merge_request: {
iid: 1234, iid: 1234,
path: '/root/detached-merge-request-pipelines/merge_requests/1', path: '/root/detached-merge-request-pipelines/-/merge_requests/1',
title: 'Update README.md', title: 'Update README.md',
source_branch: 'feature-1234', source_branch: 'feature-1234',
source_branch_path: '/root/detached-merge-request-pipelines/branches/feature-1234', source_branch_path: '/root/detached-merge-request-pipelines/branches/feature-1234',
......
...@@ -17,7 +17,7 @@ describe('MergeRequest', function() { ...@@ -17,7 +17,7 @@ describe('MergeRequest', function() {
mock = new MockAdapter(axios); mock = new MockAdapter(axios);
mock mock
.onPatch(`${gl.TEST_HOST}/frontend-fixtures/merge-requests-project/merge_requests/1.json`) .onPatch(`${gl.TEST_HOST}/frontend-fixtures/merge-requests-project/-/merge_requests/1.json`)
.reply(200, {}); .reply(200, {});
this.merge = new MergeRequest(); this.merge = new MergeRequest();
...@@ -75,7 +75,7 @@ describe('MergeRequest', function() { ...@@ -75,7 +75,7 @@ describe('MergeRequest', function() {
setTimeout(() => { setTimeout(() => {
expect(axios.patch).toHaveBeenCalledWith( expect(axios.patch).toHaveBeenCalledWith(
`${gl.TEST_HOST}/frontend-fixtures/merge-requests-project/merge_requests/1.json`, `${gl.TEST_HOST}/frontend-fixtures/merge-requests-project/-/merge_requests/1.json`,
{ {
merge_request: { merge_request: {
description: '- [ ] Task List Item\n- [ ] \n- [ ] Task List Item 2\n', description: '- [ ] Task List Item\n- [ ] \n- [ ] Task List Item 2\n',
...@@ -93,7 +93,9 @@ describe('MergeRequest', function() { ...@@ -93,7 +93,9 @@ describe('MergeRequest', function() {
// eslint-disable-next-line jasmine/no-disabled-tests // eslint-disable-next-line jasmine/no-disabled-tests
xit('shows an error notification when tasklist update failed', done => { xit('shows an error notification when tasklist update failed', done => {
mock mock
.onPatch(`${gl.TEST_HOST}/frontend-fixtures/merge-requests-project/merge_requests/1.json`) .onPatch(
`${gl.TEST_HOST}/frontend-fixtures/merge-requests-project/-/merge_requests/1.json`,
)
.reply(409, {}); .reply(409, {});
$('.js-task-list-field').trigger({ $('.js-task-list-field').trigger({
......
...@@ -147,53 +147,53 @@ describe('MergeRequestTabs', function() { ...@@ -147,53 +147,53 @@ describe('MergeRequestTabs', function() {
it('changes from commits', function() { it('changes from commits', function() {
setLocation({ setLocation({
pathname: '/foo/bar/merge_requests/1/commits', pathname: '/foo/bar/-/merge_requests/1/commits',
}); });
expect(this.subject('show')).toBe('/foo/bar/merge_requests/1'); expect(this.subject('show')).toBe('/foo/bar/-/merge_requests/1');
expect(this.subject('diffs')).toBe('/foo/bar/merge_requests/1/diffs'); expect(this.subject('diffs')).toBe('/foo/bar/-/merge_requests/1/diffs');
}); });
it('changes from diffs', function() { it('changes from diffs', function() {
setLocation({ setLocation({
pathname: '/foo/bar/merge_requests/1/diffs', pathname: '/foo/bar/-/merge_requests/1/diffs',
}); });
expect(this.subject('show')).toBe('/foo/bar/merge_requests/1'); expect(this.subject('show')).toBe('/foo/bar/-/merge_requests/1');
expect(this.subject('commits')).toBe('/foo/bar/merge_requests/1/commits'); expect(this.subject('commits')).toBe('/foo/bar/-/merge_requests/1/commits');
}); });
it('changes from diffs.html', function() { it('changes from diffs.html', function() {
setLocation({ setLocation({
pathname: '/foo/bar/merge_requests/1/diffs.html', pathname: '/foo/bar/-/merge_requests/1/diffs.html',
}); });
expect(this.subject('show')).toBe('/foo/bar/merge_requests/1'); expect(this.subject('show')).toBe('/foo/bar/-/merge_requests/1');
expect(this.subject('commits')).toBe('/foo/bar/merge_requests/1/commits'); expect(this.subject('commits')).toBe('/foo/bar/-/merge_requests/1/commits');
}); });
it('changes from notes', function() { it('changes from notes', function() {
setLocation({ setLocation({
pathname: '/foo/bar/merge_requests/1', pathname: '/foo/bar/-/merge_requests/1',
}); });
expect(this.subject('diffs')).toBe('/foo/bar/merge_requests/1/diffs'); expect(this.subject('diffs')).toBe('/foo/bar/-/merge_requests/1/diffs');
expect(this.subject('commits')).toBe('/foo/bar/merge_requests/1/commits'); expect(this.subject('commits')).toBe('/foo/bar/-/merge_requests/1/commits');
}); });
it('includes search parameters and hash string', function() { it('includes search parameters and hash string', function() {
setLocation({ setLocation({
pathname: '/foo/bar/merge_requests/1/diffs', pathname: '/foo/bar/-/merge_requests/1/diffs',
search: '?view=parallel', search: '?view=parallel',
hash: '#L15-35', hash: '#L15-35',
}); });
expect(this.subject('show')).toBe('/foo/bar/merge_requests/1?view=parallel#L15-35'); expect(this.subject('show')).toBe('/foo/bar/-/merge_requests/1?view=parallel#L15-35');
}); });
it('replaces the current history state', function() { it('replaces the current history state', function() {
setLocation({ setLocation({
pathname: '/foo/bar/merge_requests/1', pathname: '/foo/bar/-/merge_requests/1',
}); });
const newState = this.subject('commits'); const newState = this.subject('commits');
...@@ -208,10 +208,10 @@ describe('MergeRequestTabs', function() { ...@@ -208,10 +208,10 @@ describe('MergeRequestTabs', function() {
it('treats "show" like "notes"', function() { it('treats "show" like "notes"', function() {
setLocation({ setLocation({
pathname: '/foo/bar/merge_requests/1/commits', pathname: '/foo/bar/-/merge_requests/1/commits',
}); });
expect(this.subject('show')).toBe('/foo/bar/merge_requests/1'); expect(this.subject('show')).toBe('/foo/bar/-/merge_requests/1');
}); });
}); });
......
...@@ -30,7 +30,7 @@ describe('noteActions', () => { ...@@ -30,7 +30,7 @@ describe('noteActions', () => {
canAwardEmoji: true, canAwardEmoji: true,
canReportAsAbuse: true, canReportAsAbuse: true,
noteId: '539', noteId: '539',
noteUrl: `${TEST_HOST}/group/project/merge_requests/1#note_1`, noteUrl: `${TEST_HOST}/group/project/-/merge_requests/1#note_1`,
reportAbusePath: `${TEST_HOST}/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-ce%2Fissues%2F7%23note_539&user_id=26`, reportAbusePath: `${TEST_HOST}/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-ce%2Fissues%2F7%23note_539&user_id=26`,
showReply: false, showReply: false,
}; };
......
...@@ -157,7 +157,7 @@ describe Banzai::Filter::RelativeLinkFilter do ...@@ -157,7 +157,7 @@ describe Banzai::Filter::RelativeLinkFilter do
end end
it 'does not modify relative URLs in system notes' do it 'does not modify relative URLs in system notes' do
path = "#{project_path}/merge_requests/1/diffs" path = "#{project_path}/-/merge_requests/1/diffs"
doc = filter(link(path), system_note: true) doc = filter(link(path), system_note: true)
expect(doc.at_css('a')['href']).to eq path expect(doc.at_css('a')['href']).to eq path
......
...@@ -77,7 +77,7 @@ describe Gitlab::DataBuilder::Pipeline do ...@@ -77,7 +77,7 @@ describe Gitlab::DataBuilder::Pipeline do
expect(merge_request_attrs[:target_project_id]).to eq(merge_request.target_project_id) expect(merge_request_attrs[:target_project_id]).to eq(merge_request.target_project_id)
expect(merge_request_attrs[:state]).to eq(merge_request.state) expect(merge_request_attrs[:state]).to eq(merge_request.state)
expect(merge_request_attrs[:merge_status]).to eq(merge_request.merge_status) expect(merge_request_attrs[:merge_status]).to eq(merge_request.merge_status)
expect(merge_request_attrs[:url]).to eq("http://localhost/#{merge_request.target_project.full_path}/merge_requests/#{merge_request.iid}") expect(merge_request_attrs[:url]).to eq("http://localhost/#{merge_request.target_project.full_path}/-/merge_requests/#{merge_request.iid}")
end end
end end
end end
......
...@@ -55,7 +55,7 @@ describe Gitlab::UrlBuilder do ...@@ -55,7 +55,7 @@ describe Gitlab::UrlBuilder do
url = described_class.build(merge_request) url = described_class.build(merge_request)
expect(url).to eq "#{Settings.gitlab['url']}/#{merge_request.project.full_path}/merge_requests/#{merge_request.iid}" expect(url).to eq "#{Settings.gitlab['url']}/#{merge_request.project.full_path}/-/merge_requests/#{merge_request.iid}"
end end
end end
...@@ -118,7 +118,7 @@ describe Gitlab::UrlBuilder do ...@@ -118,7 +118,7 @@ describe Gitlab::UrlBuilder do
url = described_class.build(note) url = described_class.build(note)
expect(url).to eq "#{Settings.gitlab['url']}/#{merge_request.project.full_path}/merge_requests/#{merge_request.iid}#note_#{note.id}" expect(url).to eq "#{Settings.gitlab['url']}/#{merge_request.project.full_path}/-/merge_requests/#{merge_request.iid}#note_#{note.id}"
end end
end end
...@@ -129,7 +129,7 @@ describe Gitlab::UrlBuilder do ...@@ -129,7 +129,7 @@ describe Gitlab::UrlBuilder do
url = described_class.build(note) url = described_class.build(note)
expect(url).to eq "#{Settings.gitlab['url']}/#{merge_request.project.full_path}/merge_requests/#{merge_request.iid}#note_#{note.id}" expect(url).to eq "#{Settings.gitlab['url']}/#{merge_request.project.full_path}/-/merge_requests/#{merge_request.iid}#note_#{note.id}"
end end
end end
......
...@@ -52,7 +52,7 @@ describe ChatMessage::MergeMessage do ...@@ -52,7 +52,7 @@ describe ChatMessage::MergeMessage do
context 'open' do context 'open' do
it 'returns a message regarding opening of merge requests' do it 'returns a message regarding opening of merge requests' do
expect(subject.pretext).to eq( expect(subject.pretext).to eq(
'Test User (test.user) opened <http://somewhere.com/merge_requests/100|!100 *Merge Request title*> in <http://somewhere.com|project_name>') 'Test User (test.user) opened <http://somewhere.com/-/merge_requests/100|!100 *Merge Request title*> in <http://somewhere.com|project_name>')
expect(subject.attachments).to be_empty expect(subject.attachments).to be_empty
end end
end end
...@@ -63,7 +63,7 @@ describe ChatMessage::MergeMessage do ...@@ -63,7 +63,7 @@ describe ChatMessage::MergeMessage do
end end
it 'returns a message regarding closing of merge requests' do it 'returns a message regarding closing of merge requests' do
expect(subject.pretext).to eq( expect(subject.pretext).to eq(
'Test User (test.user) closed <http://somewhere.com/merge_requests/100|!100 *Merge Request title*> in <http://somewhere.com|project_name>') 'Test User (test.user) closed <http://somewhere.com/-/merge_requests/100|!100 *Merge Request title*> in <http://somewhere.com|project_name>')
expect(subject.attachments).to be_empty expect(subject.attachments).to be_empty
end end
end end
...@@ -77,12 +77,12 @@ describe ChatMessage::MergeMessage do ...@@ -77,12 +77,12 @@ describe ChatMessage::MergeMessage do
context 'open' do context 'open' do
it 'returns a message regarding opening of merge requests' do it 'returns a message regarding opening of merge requests' do
expect(subject.pretext).to eq( expect(subject.pretext).to eq(
'Test User (test.user) opened [!100 *Merge Request title*](http://somewhere.com/merge_requests/100) in [project_name](http://somewhere.com)') 'Test User (test.user) opened [!100 *Merge Request title*](http://somewhere.com/-/merge_requests/100) in [project_name](http://somewhere.com)')
expect(subject.attachments).to be_empty expect(subject.attachments).to be_empty
expect(subject.activity).to eq({ expect(subject.activity).to eq({
title: 'Merge Request opened by Test User (test.user)', title: 'Merge Request opened by Test User (test.user)',
subtitle: 'in [project_name](http://somewhere.com)', subtitle: 'in [project_name](http://somewhere.com)',
text: '[!100 *Merge Request title*](http://somewhere.com/merge_requests/100)', text: '[!100 *Merge Request title*](http://somewhere.com/-/merge_requests/100)',
image: 'http://someavatar.com' image: 'http://someavatar.com'
}) })
end end
...@@ -95,12 +95,12 @@ describe ChatMessage::MergeMessage do ...@@ -95,12 +95,12 @@ describe ChatMessage::MergeMessage do
it 'returns a message regarding closing of merge requests' do it 'returns a message regarding closing of merge requests' do
expect(subject.pretext).to eq( expect(subject.pretext).to eq(
'Test User (test.user) closed [!100 *Merge Request title*](http://somewhere.com/merge_requests/100) in [project_name](http://somewhere.com)') 'Test User (test.user) closed [!100 *Merge Request title*](http://somewhere.com/-/merge_requests/100) in [project_name](http://somewhere.com)')
expect(subject.attachments).to be_empty expect(subject.attachments).to be_empty
expect(subject.activity).to eq({ expect(subject.activity).to eq({
title: 'Merge Request closed by Test User (test.user)', title: 'Merge Request closed by Test User (test.user)',
subtitle: 'in [project_name](http://somewhere.com)', subtitle: 'in [project_name](http://somewhere.com)',
text: '[!100 *Merge Request title*](http://somewhere.com/merge_requests/100)', text: '[!100 *Merge Request title*](http://somewhere.com/-/merge_requests/100)',
image: 'http://someavatar.com' image: 'http://someavatar.com'
}) })
end end
......
...@@ -101,7 +101,7 @@ describe MergeRequestPresenter do ...@@ -101,7 +101,7 @@ describe MergeRequestPresenter do
allow(presenter).to receive_message_chain(:conflicts, :can_be_resolved_by?).with(user) { true } allow(presenter).to receive_message_chain(:conflicts, :can_be_resolved_by?).with(user) { true }
expect(path) expect(path)
.to eq("/#{project.full_path}/merge_requests/#{resource.iid}/conflicts") .to eq("/#{project.full_path}/-/merge_requests/#{resource.iid}/conflicts")
end end
end end
end end
...@@ -179,7 +179,7 @@ describe MergeRequestPresenter do ...@@ -179,7 +179,7 @@ describe MergeRequestPresenter do
it 'returns correct link with correct text' do it 'returns correct link with correct text' do
is_expected is_expected
.to match("#{project.full_path}/merge_requests/#{resource.iid}/assign_related_issues") .to match("#{project.full_path}/-/merge_requests/#{resource.iid}/assign_related_issues")
is_expected is_expected
.to match("Assign yourself to this issue") .to match("Assign yourself to this issue")
...@@ -192,7 +192,7 @@ describe MergeRequestPresenter do ...@@ -192,7 +192,7 @@ describe MergeRequestPresenter do
it 'returns correct link with correct text' do it 'returns correct link with correct text' do
is_expected is_expected
.to match("#{project.full_path}/merge_requests/#{resource.iid}/assign_related_issues") .to match("#{project.full_path}/-/merge_requests/#{resource.iid}/assign_related_issues")
is_expected is_expected
.to match("Assign yourself to these issues") .to match("Assign yourself to these issues")
...@@ -221,7 +221,7 @@ describe MergeRequestPresenter do ...@@ -221,7 +221,7 @@ describe MergeRequestPresenter do
.with(user) .with(user)
.and_return(true) .and_return(true)
is_expected.to eq("/#{resource.project.full_path}/merge_requests/#{resource.iid}/cancel_auto_merge") is_expected.to eq("/#{resource.project.full_path}/-/merge_requests/#{resource.iid}/cancel_auto_merge")
end end
end end
...@@ -248,7 +248,7 @@ describe MergeRequestPresenter do ...@@ -248,7 +248,7 @@ describe MergeRequestPresenter do
.and_return(true) .and_return(true)
is_expected is_expected
.to eq("/#{resource.project.full_path}/merge_requests/#{resource.iid}/merge") .to eq("/#{resource.project.full_path}/-/merge_requests/#{resource.iid}/merge")
end end
end end
...@@ -312,7 +312,7 @@ describe MergeRequestPresenter do ...@@ -312,7 +312,7 @@ describe MergeRequestPresenter do
project.add_maintainer(user) project.add_maintainer(user)
is_expected is_expected
.to eq("/#{resource.project.full_path}/merge_requests/#{resource.iid}/remove_wip") .to eq("/#{resource.project.full_path}/-/merge_requests/#{resource.iid}/remove_wip")
end end
end end
...@@ -535,7 +535,7 @@ describe MergeRequestPresenter do ...@@ -535,7 +535,7 @@ describe MergeRequestPresenter do
it 'returns path' do it 'returns path' do
is_expected is_expected
.to eq("/#{project.full_path}/merge_requests/#{resource.iid}/rebase") .to eq("/#{project.full_path}/-/merge_requests/#{resource.iid}/rebase")
end end
end end
......
...@@ -852,7 +852,7 @@ describe API::Internal::Base do ...@@ -852,7 +852,7 @@ describe API::Internal::Base do
message = <<~MESSAGE.strip message = <<~MESSAGE.strip
To create a merge request for #{branch_name}, visit: To create a merge request for #{branch_name}, visit:
http://#{Gitlab.config.gitlab.host}/#{project.full_path}/merge_requests/new?merge_request%5Bsource_branch%5D=#{branch_name} http://#{Gitlab.config.gitlab.host}/#{project.full_path}/-/merge_requests/new?merge_request%5Bsource_branch%5D=#{branch_name}
MESSAGE MESSAGE
expect(json_response['messages']).to include(build_basic_message(message)) expect(json_response['messages']).to include(build_basic_message(message))
...@@ -909,7 +909,7 @@ describe API::Internal::Base do ...@@ -909,7 +909,7 @@ describe API::Internal::Base do
message = <<~MESSAGE.strip message = <<~MESSAGE.strip
View merge request for #{branch_name}: View merge request for #{branch_name}:
http://#{Gitlab.config.gitlab.host}/#{project.full_path}/merge_requests/1 http://#{Gitlab.config.gitlab.host}/#{project.full_path}/-/merge_requests/1
MESSAGE MESSAGE
expect(json_response['messages']).to include(build_basic_message(message)) expect(json_response['messages']).to include(build_basic_message(message))
......
...@@ -76,7 +76,7 @@ describe API::Releases do ...@@ -76,7 +76,7 @@ describe API::Releases do
mr_uri = URI.parse(links['merge_requests_url']) mr_uri = URI.parse(links['merge_requests_url'])
issue_uri = URI.parse(links['issues_url']) issue_uri = URI.parse(links['issues_url'])
expect(mr_uri.path).to eq("#{path_base}/merge_requests") expect(mr_uri.path).to eq("#{path_base}/-/merge_requests")
expect(issue_uri.path).to eq("#{path_base}/issues") expect(issue_uri.path).to eq("#{path_base}/issues")
expect(mr_uri.query).to eq(expected_query) expect(mr_uri.query).to eq(expected_query)
expect(issue_uri.query).to eq(expected_query) expect(issue_uri.query).to eq(expected_query)
......
...@@ -4,7 +4,7 @@ require 'spec_helper' ...@@ -4,7 +4,7 @@ require 'spec_helper'
describe 'merge requests discussions' do describe 'merge requests discussions' do
# Further tests can be found at merge_requests_controller_spec.rb # Further tests can be found at merge_requests_controller_spec.rb
describe 'GET /:namespace/:project/merge_requests/:iid/discussions' do describe 'GET /:namespace/:project/-/merge_requests/:iid/discussions' do
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
let(:user) { project.owner } let(:user) { project.owner }
let(:merge_request) { create(:merge_request_with_diffs, target_project: project, source_project: project) } let(:merge_request) { create(:merge_request_with_diffs, target_project: project, source_project: project) }
......
...@@ -26,8 +26,8 @@ describe 'Update of user activity' do ...@@ -26,8 +26,8 @@ describe 'Update of user activity' do
'/dashboard/todos', '/dashboard/todos',
'/group/project/issues', '/group/project/issues',
'/group/project/issues/10', '/group/project/issues/10',
'/group/project/merge_requests', '/group/project/-/merge_requests',
'/group/project/merge_requests/15' '/group/project/-/merge_requests/15'
] ]
context 'without an authenticated user' do context 'without an authenticated user' do
......
...@@ -292,71 +292,77 @@ describe 'project routing' do ...@@ -292,71 +292,77 @@ describe 'project routing' do
describe Projects::MergeRequestsController, 'routing' do describe Projects::MergeRequestsController, 'routing' do
it 'to #commits' do it 'to #commits' do
expect(get('/gitlab/gitlabhq/merge_requests/1/commits.json')).to route_to('projects/merge_requests#commits', namespace_id: 'gitlab', project_id: 'gitlabhq', id: '1', format: 'json') expect(get('/gitlab/gitlabhq/-/merge_requests/1/commits.json')).to route_to('projects/merge_requests#commits', namespace_id: 'gitlab', project_id: 'gitlabhq', id: '1', format: 'json')
end end
it 'to #pipelines' do it 'to #pipelines' do
expect(get('/gitlab/gitlabhq/merge_requests/1/pipelines.json')).to route_to('projects/merge_requests#pipelines', namespace_id: 'gitlab', project_id: 'gitlabhq', id: '1', format: 'json') expect(get('/gitlab/gitlabhq/-/merge_requests/1/pipelines.json')).to route_to('projects/merge_requests#pipelines', namespace_id: 'gitlab', project_id: 'gitlabhq', id: '1', format: 'json')
end end
it 'to #merge' do it 'to #merge' do
expect(post('/gitlab/gitlabhq/merge_requests/1/merge')).to route_to( expect(post('/gitlab/gitlabhq/-/merge_requests/1/merge')).to route_to(
'projects/merge_requests#merge', 'projects/merge_requests#merge',
namespace_id: 'gitlab', project_id: 'gitlabhq', id: '1' namespace_id: 'gitlab', project_id: 'gitlabhq', id: '1'
) )
end end
it 'to #show' do it 'to #show' do
expect(get('/gitlab/gitlabhq/merge_requests/1.diff')).to route_to('projects/merge_requests#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: '1', format: 'diff') expect(get('/gitlab/gitlabhq/-/merge_requests/1.diff')).to route_to('projects/merge_requests#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: '1', format: 'diff')
expect(get('/gitlab/gitlabhq/merge_requests/1.patch')).to route_to('projects/merge_requests#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: '1', format: 'patch') expect(get('/gitlab/gitlabhq/-/merge_requests/1.patch')).to route_to('projects/merge_requests#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: '1', format: 'patch')
expect(get('/gitlab/gitlabhq/merge_requests/1/diffs')).to route_to('projects/merge_requests#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: '1', tab: 'diffs') expect(get('/gitlab/gitlabhq/-/merge_requests/1/diffs')).to route_to('projects/merge_requests#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: '1', tab: 'diffs')
expect(get('/gitlab/gitlabhq/merge_requests/1/commits')).to route_to('projects/merge_requests#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: '1', tab: 'commits') expect(get('/gitlab/gitlabhq/-/merge_requests/1/commits')).to route_to('projects/merge_requests#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: '1', tab: 'commits')
expect(get('/gitlab/gitlabhq/merge_requests/1/pipelines')).to route_to('projects/merge_requests#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: '1', tab: 'pipelines') expect(get('/gitlab/gitlabhq/-/merge_requests/1/pipelines')).to route_to('projects/merge_requests#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: '1', tab: 'pipelines')
end end
it_behaves_like 'RESTful project resources' do it_behaves_like 'RESTful project resources' do
let(:controller) { 'merge_requests' } let(:controller) { 'merge_requests' }
let(:actions) { [:index, :edit, :show, :update] } let(:actions) { [:index, :edit, :show, :update] }
let(:controller_path) { '/-/merge_requests' }
end end
it_behaves_like 'redirecting a legacy project path', "/gitlab/gitlabhq/merge_requests", "/gitlab/gitlabhq/-/merge_requests"
it_behaves_like 'redirecting a legacy project path', "/gitlab/gitlabhq/merge_requests/1/diffs", "/gitlab/gitlabhq/-/merge_requests/1/diffs"
end end
describe Projects::MergeRequests::CreationsController, 'routing' do describe Projects::MergeRequests::CreationsController, 'routing' do
it 'to #new' do it 'to #new' do
expect(get('/gitlab/gitlabhq/merge_requests/new')).to route_to('projects/merge_requests/creations#new', namespace_id: 'gitlab', project_id: 'gitlabhq') expect(get('/gitlab/gitlabhq/-/merge_requests/new')).to route_to('projects/merge_requests/creations#new', namespace_id: 'gitlab', project_id: 'gitlabhq')
expect(get('/gitlab/gitlabhq/merge_requests/new/diffs')).to route_to('projects/merge_requests/creations#new', namespace_id: 'gitlab', project_id: 'gitlabhq', tab: 'diffs') expect(get('/gitlab/gitlabhq/-/merge_requests/new/diffs')).to route_to('projects/merge_requests/creations#new', namespace_id: 'gitlab', project_id: 'gitlabhq', tab: 'diffs')
expect(get('/gitlab/gitlabhq/merge_requests/new/pipelines')).to route_to('projects/merge_requests/creations#new', namespace_id: 'gitlab', project_id: 'gitlabhq', tab: 'pipelines') expect(get('/gitlab/gitlabhq/-/merge_requests/new/pipelines')).to route_to('projects/merge_requests/creations#new', namespace_id: 'gitlab', project_id: 'gitlabhq', tab: 'pipelines')
end end
it 'to #create' do it 'to #create' do
expect(post('/gitlab/gitlabhq/merge_requests')).to route_to('projects/merge_requests/creations#create', namespace_id: 'gitlab', project_id: 'gitlabhq') expect(post('/gitlab/gitlabhq/-/merge_requests')).to route_to('projects/merge_requests/creations#create', namespace_id: 'gitlab', project_id: 'gitlabhq')
end end
it 'to #branch_from' do it 'to #branch_from' do
expect(get('/gitlab/gitlabhq/merge_requests/new/branch_from')).to route_to('projects/merge_requests/creations#branch_from', namespace_id: 'gitlab', project_id: 'gitlabhq') expect(get('/gitlab/gitlabhq/-/merge_requests/new/branch_from')).to route_to('projects/merge_requests/creations#branch_from', namespace_id: 'gitlab', project_id: 'gitlabhq')
end end
it 'to #branch_to' do it 'to #branch_to' do
expect(get('/gitlab/gitlabhq/merge_requests/new/branch_to')).to route_to('projects/merge_requests/creations#branch_to', namespace_id: 'gitlab', project_id: 'gitlabhq') expect(get('/gitlab/gitlabhq/-/merge_requests/new/branch_to')).to route_to('projects/merge_requests/creations#branch_to', namespace_id: 'gitlab', project_id: 'gitlabhq')
end end
it 'to #pipelines' do it 'to #pipelines' do
expect(get('/gitlab/gitlabhq/merge_requests/new/pipelines.json')).to route_to('projects/merge_requests/creations#pipelines', namespace_id: 'gitlab', project_id: 'gitlabhq', format: 'json') expect(get('/gitlab/gitlabhq/-/merge_requests/new/pipelines.json')).to route_to('projects/merge_requests/creations#pipelines', namespace_id: 'gitlab', project_id: 'gitlabhq', format: 'json')
end end
it 'to #diffs' do it 'to #diffs' do
expect(get('/gitlab/gitlabhq/merge_requests/new/diffs.json')).to route_to('projects/merge_requests/creations#diffs', namespace_id: 'gitlab', project_id: 'gitlabhq', format: 'json') expect(get('/gitlab/gitlabhq/-/merge_requests/new/diffs.json')).to route_to('projects/merge_requests/creations#diffs', namespace_id: 'gitlab', project_id: 'gitlabhq', format: 'json')
end end
it_behaves_like 'redirecting a legacy project path', "/gitlab/gitlabhq/merge_requests/new", "/gitlab/gitlabhq/-/merge_requests/new"
end end
describe Projects::MergeRequests::DiffsController, 'routing' do describe Projects::MergeRequests::DiffsController, 'routing' do
it 'to #show' do it 'to #show' do
expect(get('/gitlab/gitlabhq/merge_requests/1/diffs.json')).to route_to('projects/merge_requests/diffs#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: '1', format: 'json') expect(get('/gitlab/gitlabhq/-/merge_requests/1/diffs.json')).to route_to('projects/merge_requests/diffs#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: '1', format: 'json')
end end
end end
describe Projects::MergeRequests::ConflictsController, 'routing' do describe Projects::MergeRequests::ConflictsController, 'routing' do
it 'to #show' do it 'to #show' do
expect(get('/gitlab/gitlabhq/merge_requests/1/conflicts')).to route_to('projects/merge_requests/conflicts#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: '1') expect(get('/gitlab/gitlabhq/-/merge_requests/1/conflicts')).to route_to('projects/merge_requests/conflicts#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: '1')
end end
end end
# raw_project_snippet GET /:project_id/snippets/:id/raw(.:format) snippets#raw # raw_project_snippet GET /:project_id/snippets/:id/raw(.:format) snippets#raw
......
...@@ -45,12 +45,12 @@ describe MergeRequestWidgetEntity do ...@@ -45,12 +45,12 @@ describe MergeRequestWidgetEntity do
it 'has email_patches_path' do it 'has email_patches_path' do
expect(subject[:email_patches_path]) expect(subject[:email_patches_path])
.to eq("/#{resource.project.full_path}/merge_requests/#{resource.iid}.patch") .to eq("/#{resource.project.full_path}/-/merge_requests/#{resource.iid}.patch")
end end
it 'has plain_diff_path' do it 'has plain_diff_path' do
expect(subject[:plain_diff_path]) expect(subject[:plain_diff_path])
.to eq("/#{resource.project.full_path}/merge_requests/#{resource.iid}.diff") .to eq("/#{resource.project.full_path}/-/merge_requests/#{resource.iid}.diff")
end end
describe 'when source project is deleted' do describe 'when source project is deleted' do
......
...@@ -26,7 +26,7 @@ describe PaginatedDiffEntity do ...@@ -26,7 +26,7 @@ describe PaginatedDiffEntity do
expect(subject[:pagination]).to eq( expect(subject[:pagination]).to eq(
current_page: 2, current_page: 2,
next_page: 3, next_page: 3,
next_page_href: "/#{merge_request.project.full_path}/merge_requests/#{merge_request.iid}/diffs_batch.json?page=3", next_page_href: "/#{merge_request.project.full_path}/-/merge_requests/#{merge_request.iid}/diffs_batch.json?page=3",
total_pages: 7 total_pages: 7
) )
end end
......
...@@ -11,7 +11,7 @@ describe Ci::ExpirePipelineCacheService do ...@@ -11,7 +11,7 @@ describe Ci::ExpirePipelineCacheService do
describe '#execute' do describe '#execute' do
it 'invalidates Etag caching for project pipelines path' do it 'invalidates Etag caching for project pipelines path' do
pipelines_path = "/#{project.full_path}/pipelines.json" pipelines_path = "/#{project.full_path}/pipelines.json"
new_mr_pipelines_path = "/#{project.full_path}/merge_requests/new.json" new_mr_pipelines_path = "/#{project.full_path}/-/merge_requests/new.json"
pipeline_path = "/#{project.full_path}/pipelines/#{pipeline.id}.json" pipeline_path = "/#{project.full_path}/pipelines/#{pipeline.id}.json"
expect_any_instance_of(Gitlab::EtagCaching::Store).to receive(:touch).with(pipelines_path) expect_any_instance_of(Gitlab::EtagCaching::Store).to receive(:touch).with(pipelines_path)
...@@ -24,7 +24,7 @@ describe Ci::ExpirePipelineCacheService do ...@@ -24,7 +24,7 @@ describe Ci::ExpirePipelineCacheService do
it 'invalidates Etag caching for merge request pipelines if pipeline runs on any commit of that source branch' do it 'invalidates Etag caching for merge request pipelines if pipeline runs on any commit of that source branch' do
pipeline = create(:ci_empty_pipeline, status: 'created', project: project, ref: 'master') pipeline = create(:ci_empty_pipeline, status: 'created', project: project, ref: 'master')
merge_request = create(:merge_request, source_project: project, source_branch: pipeline.ref) merge_request = create(:merge_request, source_project: project, source_branch: pipeline.ref)
merge_request_pipelines_path = "/#{project.full_path}/merge_requests/#{merge_request.iid}/pipelines.json" merge_request_pipelines_path = "/#{project.full_path}/-/merge_requests/#{merge_request.iid}/pipelines.json"
allow_any_instance_of(Gitlab::EtagCaching::Store).to receive(:touch) allow_any_instance_of(Gitlab::EtagCaching::Store).to receive(:touch)
expect_any_instance_of(Gitlab::EtagCaching::Store).to receive(:touch).with(merge_request_pipelines_path) expect_any_instance_of(Gitlab::EtagCaching::Store).to receive(:touch).with(merge_request_pipelines_path)
......
...@@ -8,8 +8,8 @@ describe MergeRequests::GetUrlsService do ...@@ -8,8 +8,8 @@ describe MergeRequests::GetUrlsService do
let(:project) { create(:project, :public, :repository) } let(:project) { create(:project, :public, :repository) }
let(:service) { described_class.new(project) } let(:service) { described_class.new(project) }
let(:source_branch) { "merge-test" } let(:source_branch) { "merge-test" }
let(:new_merge_request_url) { "http://#{Gitlab.config.gitlab.host}/#{project.full_path}/merge_requests/new?merge_request%5Bsource_branch%5D=#{source_branch}" } let(:new_merge_request_url) { "http://#{Gitlab.config.gitlab.host}/#{project.full_path}/-/merge_requests/new?merge_request%5Bsource_branch%5D=#{source_branch}" }
let(:show_merge_request_url) { "http://#{Gitlab.config.gitlab.host}/#{project.full_path}/merge_requests/#{merge_request.iid}" } let(:show_merge_request_url) { "http://#{Gitlab.config.gitlab.host}/#{project.full_path}/-/merge_requests/#{merge_request.iid}" }
let(:new_branch_changes) { "#{Gitlab::Git::BLANK_SHA} 570e7b2abdd848b95f2f578043fc23bd6f6fd24d refs/heads/#{source_branch}" } let(:new_branch_changes) { "#{Gitlab::Git::BLANK_SHA} 570e7b2abdd848b95f2f578043fc23bd6f6fd24d refs/heads/#{source_branch}" }
let(:deleted_branch_changes) { "d14d6c0abdd253381df51a723d58691b2ee1ab08 #{Gitlab::Git::BLANK_SHA} refs/heads/#{source_branch}" } let(:deleted_branch_changes) { "d14d6c0abdd253381df51a723d58691b2ee1ab08 #{Gitlab::Git::BLANK_SHA} refs/heads/#{source_branch}" }
let(:existing_branch_changes) { "d14d6c0abdd253381df51a723d58691b2ee1ab08 570e7b2abdd848b95f2f578043fc23bd6f6fd24d refs/heads/#{source_branch}" } let(:existing_branch_changes) { "d14d6c0abdd253381df51a723d58691b2ee1ab08 570e7b2abdd848b95f2f578043fc23bd6f6fd24d refs/heads/#{source_branch}" }
...@@ -127,7 +127,7 @@ describe MergeRequests::GetUrlsService do ...@@ -127,7 +127,7 @@ describe MergeRequests::GetUrlsService do
let(:new_branch_changes) { "#{Gitlab::Git::BLANK_SHA} 570e7b2abdd848b95f2f578043fc23bd6f6fd24d refs/heads/new_branch" } let(:new_branch_changes) { "#{Gitlab::Git::BLANK_SHA} 570e7b2abdd848b95f2f578043fc23bd6f6fd24d refs/heads/new_branch" }
let(:existing_branch_changes) { "d14d6c0abdd253381df51a723d58691b2ee1ab08 570e7b2abdd848b95f2f578043fc23bd6f6fd24d refs/heads/markdown" } let(:existing_branch_changes) { "d14d6c0abdd253381df51a723d58691b2ee1ab08 570e7b2abdd848b95f2f578043fc23bd6f6fd24d refs/heads/markdown" }
let(:changes) { "#{new_branch_changes}\n#{existing_branch_changes}" } let(:changes) { "#{new_branch_changes}\n#{existing_branch_changes}" }
let(:new_merge_request_url) { "http://#{Gitlab.config.gitlab.host}/#{project.full_path}/merge_requests/new?merge_request%5Bsource_branch%5D=new_branch" } let(:new_merge_request_url) { "http://#{Gitlab.config.gitlab.host}/#{project.full_path}/-/merge_requests/new?merge_request%5Bsource_branch%5D=new_branch" }
it 'returns 2 urls for both creating new and showing merge request' do it 'returns 2 urls for both creating new and showing merge request' do
result = service.execute(changes) result = service.execute(changes)
......
...@@ -328,7 +328,7 @@ describe SystemNoteService do ...@@ -328,7 +328,7 @@ describe SystemNoteService do
url = if type == 'commit' url = if type == 'commit'
"#{Settings.gitlab.base_url}/#{project.namespace.path}/#{project.path}/commit/#{commit.id}" "#{Settings.gitlab.base_url}/#{project.namespace.path}/#{project.path}/commit/#{commit.id}"
else else
"#{Settings.gitlab.base_url}/#{project.namespace.path}/#{project.path}/merge_requests/#{merge_request.iid}" "#{Settings.gitlab.base_url}/#{project.namespace.path}/#{project.path}/-/merge_requests/#{merge_request.iid}"
end end
link = double(object: { 'url' => url }) link = double(object: { 'url' => url })
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment