Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
a8b6b632
Commit
a8b6b632
authored
Jan 20, 2020
by
Dmytro Zaporozhets
Committed by
Douglas Barbosa Alexandre
Jan 20, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move merge request routes under /-/ scope
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
0282ab15
Changes
49
Show whitespace changes
Inline
Side-by-side
Showing
49 changed files
with
210 additions
and
202 deletions
+210
-202
app/assets/javascripts/ide/stores/utils.js
app/assets/javascripts/ide/stores/utils.js
+1
-1
app/assets/javascripts/merge_request_tabs.js
app/assets/javascripts/merge_request_tabs.js
+9
-9
app/models/project_services/chat_message/merge_message.rb
app/models/project_services/chat_message/merge_message.rb
+1
-1
app/models/project_services/hipchat_service.rb
app/models/project_services/hipchat_service.rb
+1
-1
bin/secpick
bin/secpick
+2
-2
changelogs/unreleased/dz-move-project-routes.yml
changelogs/unreleased/dz-move-project-routes.yml
+5
-0
config/routes/project.rb
config/routes/project.rb
+3
-12
ee/app/assets/javascripts/onboarding/tour_parts.js
ee/app/assets/javascripts/onboarding/tour_parts.js
+2
-2
ee/config/routes/project.rb
ee/config/routes/project.rb
+2
-11
ee/spec/frontend/notes/components/note_actions_spec.js
ee/spec/frontend/notes/components/note_actions_spec.js
+1
-1
ee/spec/frontend/notes/mock_data.js
ee/spec/frontend/notes/mock_data.js
+13
-13
ee/spec/helpers/ee/emails_helper_spec.rb
ee/spec/helpers/ee/emails_helper_spec.rb
+4
-4
ee/spec/models/project_services/chat_message/merge_message_spec.rb
...odels/project_services/chat_message/merge_message_spec.rb
+4
-4
ee/spec/presenters/merge_request_presenter_spec.rb
ee/spec/presenters/merge_request_presenter_spec.rb
+1
-1
public/robots.txt
public/robots.txt
+5
-5
spec/frontend/diffs/mock_data/merge_request_diffs.js
spec/frontend/diffs/mock_data/merge_request_diffs.js
+4
-4
spec/frontend/notes/mock_data.js
spec/frontend/notes/mock_data.js
+13
-13
spec/frontend/performance_bar/components/request_selector_spec.js
...ntend/performance_bar/components/request_selector_spec.js
+1
-1
spec/frontend/performance_bar/stores/performance_bar_store_spec.js
...tend/performance_bar/stores/performance_bar_store_spec.js
+2
-2
spec/helpers/award_emoji_helper_spec.rb
spec/helpers/award_emoji_helper_spec.rb
+1
-1
spec/helpers/events_helper_spec.rb
spec/helpers/events_helper_spec.rb
+1
-1
spec/helpers/labels_helper_spec.rb
spec/helpers/labels_helper_spec.rb
+9
-1
spec/javascripts/diffs/components/compare_versions_dropdown_spec.js
...cripts/diffs/components/compare_versions_dropdown_spec.js
+1
-1
spec/javascripts/diffs/mock_data/diff_discussions.js
spec/javascripts/diffs/mock_data/diff_discussions.js
+16
-11
spec/javascripts/ide/stores/modules/commit/actions_spec.js
spec/javascripts/ide/stores/modules/commit/actions_spec.js
+1
-1
spec/javascripts/jobs/components/stages_dropdown_spec.js
spec/javascripts/jobs/components/stages_dropdown_spec.js
+1
-1
spec/javascripts/merge_request_spec.js
spec/javascripts/merge_request_spec.js
+5
-3
spec/javascripts/merge_request_tabs_spec.js
spec/javascripts/merge_request_tabs_spec.js
+17
-17
spec/javascripts/notes/components/note_actions_spec.js
spec/javascripts/notes/components/note_actions_spec.js
+1
-1
spec/javascripts/search_autocomplete_spec.js
spec/javascripts/search_autocomplete_spec.js
+3
-3
spec/javascripts/vue_mr_widget/mock_data.js
spec/javascripts/vue_mr_widget/mock_data.js
+13
-13
spec/lib/banzai/filter/repository_link_filter_spec.rb
spec/lib/banzai/filter/repository_link_filter_spec.rb
+1
-1
spec/lib/gitlab/danger/helper_spec.rb
spec/lib/gitlab/danger/helper_spec.rb
+2
-2
spec/lib/gitlab/data_builder/pipeline_spec.rb
spec/lib/gitlab/data_builder/pipeline_spec.rb
+1
-1
spec/lib/gitlab/etag_caching/router_spec.rb
spec/lib/gitlab/etag_caching/router_spec.rb
+2
-2
spec/lib/gitlab/internal_post_receive/response_spec.rb
spec/lib/gitlab/internal_post_receive/response_spec.rb
+6
-6
spec/lib/gitlab/url_builder_spec.rb
spec/lib/gitlab/url_builder_spec.rb
+3
-3
spec/models/project_services/chat_message/merge_message_spec.rb
...odels/project_services/chat_message/merge_message_spec.rb
+6
-6
spec/presenters/merge_request_presenter_spec.rb
spec/presenters/merge_request_presenter_spec.rb
+7
-7
spec/requests/api/internal/base_spec.rb
spec/requests/api/internal/base_spec.rb
+2
-2
spec/requests/api/releases_spec.rb
spec/requests/api/releases_spec.rb
+1
-1
spec/requests/projects/merge_requests_discussions_spec.rb
spec/requests/projects/merge_requests_discussions_spec.rb
+1
-1
spec/requests/user_activity_spec.rb
spec/requests/user_activity_spec.rb
+2
-2
spec/routing/project_routing_spec.rb
spec/routing/project_routing_spec.rb
+24
-18
spec/serializers/merge_request_widget_entity_spec.rb
spec/serializers/merge_request_widget_entity_spec.rb
+2
-2
spec/serializers/paginated_diff_entity_spec.rb
spec/serializers/paginated_diff_entity_spec.rb
+1
-1
spec/services/ci/expire_pipeline_cache_service_spec.rb
spec/services/ci/expire_pipeline_cache_service_spec.rb
+2
-2
spec/services/merge_requests/get_urls_service_spec.rb
spec/services/merge_requests/get_urls_service_spec.rb
+3
-3
spec/services/system_note_service_spec.rb
spec/services/system_note_service_spec.rb
+1
-1
No files found.
app/assets/javascripts/ide/stores/utils.js
View file @
a8b6b632
...
...
@@ -163,7 +163,7 @@ export const createCommitPayload = ({
});
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
)
=>
{
if
(
a
.
type
===
'
tree
'
&&
b
.
type
===
'
blob
'
)
{
...
...
app/assets/javascripts/merge_request_tabs.js
View file @
a8b6b632
...
...
@@ -32,17 +32,17 @@ import { __ } from './locale';
//
// <ul class="nav-links merge-request-tabs">
// <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
// </a>
// </li>
// <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
// </a>
// </li>
// <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
// </a>
// </li>
...
...
@@ -260,17 +260,17 @@ export default class MergeRequestTabs {
//
// Examples:
//
// location.pathname # => "/namespace/project/merge_requests/1"
// location.pathname # => "/namespace/project/
-/
merge_requests/1"
// 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')
// 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')
// location.pathname # => "/namespace/project/merge_requests/1/commits"
// location.pathname # => "/namespace/project/
-/
merge_requests/1/commits"
//
// Returns the new URL String
setCurrentAction
(
action
)
{
...
...
app/models/project_services/chat_message/merge_message.rb
View file @
a8b6b632
...
...
@@ -62,7 +62,7 @@ module ChatMessage
end
def
merge_request_url
"
#{
project_url
}
/merge_requests/
#{
merge_request_iid
}
"
"
#{
project_url
}
/
-/
merge_requests/
#{
merge_request_iid
}
"
end
# overridden in EE
...
...
app/models/project_services/hipchat_service.rb
View file @
a8b6b632
...
...
@@ -184,7 +184,7 @@ class HipchatService < Service
description
=
obj_attr
[
:description
]
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>"
message
=
[
"
#{
user_name
}
#{
state
}
#{
merge_request_link
}
in "
\
"
#{
project_link
}
: <b>
#{
title
}
</b>"
]
...
...
bin/secpick
View file @
a8b6b632
...
...
@@ -15,8 +15,8 @@ module Secpick
DEFAULT_REMOTE
=
'dev'
.
freeze
SECURITY_REMOTE
=
'security'
.
freeze
NEW_MR_URL
=
'https://dev.gitlab.org/gitlab/gitlabhq/merge_requests/new'
.
freeze
SECURITY_MR_URL
=
'https://gitlab.com/gitlab-org/security/gitlab/merge_requests/new'
.
freeze
NEW_MR_URL
=
'https://dev.gitlab.org/gitlab/gitlabhq/
-/
merge_requests/new'
.
freeze
SECURITY_MR_URL
=
'https://gitlab.com/gitlab-org/security/gitlab/
-/
merge_requests/new'
.
freeze
class
SecurityFix
def
initialize
...
...
changelogs/unreleased/dz-move-project-routes.yml
0 → 100644
View file @
a8b6b632
---
title
:
Move merge request routes under /-/ scope
merge_request
:
21126
author
:
type
:
deprecated
config/routes/project.rb
View file @
a8b6b632
...
...
@@ -281,6 +281,8 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
end
end
draw
:merge_requests
# The wiki and repository routing contains wildcard characters so
# its preferable to keep it below all other project routes
draw
:repository_scoped
...
...
@@ -339,17 +341,6 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
end
end
# Unscoped route. It will be replaced with redirect to /-/merge_requests/
# Issue https://gitlab.com/gitlab-org/gitlab/issues/118849
draw
:merge_requests
# To ensure an old unscoped routing is used for the UI we need to
# add prefix 'as' to the scope routing and place it below original MR routing.
# Issue https://gitlab.com/gitlab-org/gitlab/issues/118849
scope
'-'
,
as:
'scoped'
do
draw
:merge_requests
end
resources
:pipelines
,
only:
[
:index
,
:new
,
:create
,
:show
,
:destroy
]
do
collection
do
resource
:pipelines_settings
,
path:
'settings'
,
only:
[
:show
,
:update
]
...
...
@@ -510,7 +501,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
:forks
,
:group_links
,
:import
,
:avatar
,
:mirror
,
:cycle_analytics
,
:mattermost
,
:variables
,
:triggers
,
:environments
,
:protected_environments
,
:error_tracking
,
:serverless
,
:clusters
,
:audit_events
,
:wikis
)
:serverless
,
:clusters
,
:audit_events
,
:wikis
,
:merge_requests
)
end
# rubocop: disable Cop/PutProjectRoutesUnderScope
...
...
ee/app/assets/javascripts/onboarding/tour_parts.js
View file @
a8b6b632
...
...
@@ -253,7 +253,7 @@ const GUIDED_GITLAB_TOUR = [
},
},
{
forUrl
:
({
projectFullPath
})
=>
new
RegExp
(
`
${
projectFullPath
}
/merge_requests$`
,
''
),
forUrl
:
({
projectFullPath
})
=>
new
RegExp
(
`
${
projectFullPath
}
/
-/
merge_requests$`
,
''
),
getHelpContent
:
()
=>
[
{
text
:
s__
(
...
...
@@ -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
:
()
=>
[
{
text
:
sprintf
(
...
...
ee/config/routes/project.rb
View file @
a8b6b632
...
...
@@ -83,6 +83,8 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
resources
:code_reviews
,
only:
[
:index
]
end
end
draw
:merge_requests_ee
end
# End of the /-/ scope.
...
...
@@ -138,17 +140,6 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
get
'/service_desk'
=>
'service_desk#show'
,
as: :service_desk
put
'/service_desk'
=>
'service_desk#update'
,
as: :service_desk_refresh
# Unscoped route. It will be replaced with redirect to /-/merge_requests/
# Issue https://gitlab.com/gitlab-org/gitlab/issues/118849
draw
:merge_requests_ee
# To ensure an old unscoped routing is used for the UI we need to
# add prefix 'as' to the scope routing and place it below original MR routing.
# Issue https://gitlab.com/gitlab-org/gitlab/issues/118849
scope
'-'
,
as:
'scoped'
do
draw
:merge_requests_ee
end
post
'/restore'
=>
'/projects#restore'
,
as: :restore
resources
:approvers
,
only: :destroy
...
...
ee/spec/frontend/notes/components/note_actions_spec.js
View file @
a8b6b632
...
...
@@ -26,7 +26,7 @@ describe('noteActions', () => {
canReportAsAbuse
:
true
,
canResolve
:
true
,
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`
,
showReply
:
false
,
isDraft
:
true
,
...
...
ee/spec/frontend/notes/mock_data.js
View file @
a8b6b632
...
...
@@ -52,7 +52,7 @@ export const noteableDataMock = {
time_estimate
:
0
,
title
:
'
14
'
,
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_by_id
:
1
,
web_url
:
'
/gitlab-org/gitlab-foss/issues/26
'
,
...
...
@@ -101,8 +101,8 @@ export const individualNote = {
{
name
:
'
art
'
,
user
:
{
id
:
1
,
name
:
'
Root
'
,
username
:
'
root
'
}
},
],
toggle_award_path
:
'
/gitlab-org/gitlab-foss/notes/1390/toggle_award_emoji
'
,
noteable_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
'
,
note_url
:
'
/group/project/
-/
merge_requests/1#note_1
'
,
report_abuse_path
:
'
/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
'
,
...
...
@@ -161,8 +161,8 @@ export const note = {
},
],
toggle_award_path
:
'
/gitlab-org/gitlab-foss/notes/546/toggle_award_emoji
'
,
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
'
,
noteable_note_url
:
'
/group/project/
-/
merge_requests/1#note_1
'
,
report_abuse_path
:
'
/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
'
,
...
...
@@ -204,7 +204,7 @@ export const discussionMock = {
discussion_id
:
'
9e3bd2f71a01de45fd166e6719eb380ad9f270b1
'
,
emoji_awardable
:
true
,
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
'
,
report_abuse_path
:
'
/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 = {
emoji_awardable
:
true
,
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
:
'
/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
'
,
...
...
@@ -296,7 +296,7 @@ export const discussionMock = {
discussion_id
:
'
9e3bd2f71a01de45fd166e6719eb380ad9f270b1
'
,
emoji_awardable
:
true
,
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
'
,
report_abuse_path
:
'
/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 = {
can_create_note
:
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
'
,
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 = {
},
},
],
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
'
,
report_abuse_path
:
'
/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 = {
discussion_id
:
'
70d5c92a4039a36c70100c6691c18c27e4b0a790
'
,
emoji_awardable
:
true
,
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
'
,
report_abuse_path
:
'
/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 = {
discussion_id
:
'
a3ed36e29b1957efb3b68c53e2d7a2b24b1df052
'
,
emoji_awardable
:
true
,
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
'
,
report_abuse_path
:
'
/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 = {
emoji_awardable
:
true
,
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
:
'
/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
'
,
...
...
ee/spec/helpers/ee/emails_helper_spec.rb
View file @
a8b6b632
...
...
@@ -9,7 +9,7 @@ describe EE::EmailsHelper do
where
(
:path
,
:result
)
do
'somedomain.com/groups/agroup/-/epics/231'
|
'View Epic'
'somedomain.com/aproject/issues/231'
|
'View Issue'
'somedomain.com/aproject/merge_requests/231'
|
'View Merge request'
'somedomain.com/aproject/
-/
merge_requests/231'
|
'View Merge request'
'somedomain.com/aproject/commit/al3f231'
|
'View Commit'
end
...
...
ee/spec/models/project_services/chat_message/merge_message_spec.rb
View file @
a8b6b632
...
...
@@ -36,7 +36,7 @@ RSpec.describe ChatMessage::MergeMessage do
it
'returns a message regarding completed approval of merge requests'
do
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>'
)
expect
(
subject
.
attachments
).
to
be_empty
end
...
...
@@ -49,7 +49,7 @@ RSpec.describe ChatMessage::MergeMessage do
it
'returns a message regarding revocation of completed approval of merge requests'
do
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>'
)
expect
(
subject
.
attachments
).
to
be_empty
end
...
...
@@ -62,7 +62,7 @@ RSpec.describe ChatMessage::MergeMessage do
it
'returns a message regarding added approval of merge requests'
do
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>'
)
expect
(
subject
.
attachments
).
to
be_empty
end
...
...
@@ -75,7 +75,7 @@ RSpec.describe ChatMessage::MergeMessage do
it
'returns a message regarding revoking approval of merge requests'
do
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>'
)
expect
(
subject
.
attachments
).
to
be_empty
end
...
...
ee/spec/presenters/merge_request_presenter_spec.rb
View file @
a8b6b632
...
...
@@ -36,7 +36,7 @@ describe MergeRequestPresenter do
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
describe
'#api_approvals_path'
do
...
...
public/robots.txt
View file @
a8b6b632
...
...
@@ -53,11 +53,11 @@ Disallow: /*/*/milestones/new
Disallow: /*/*/milestones/*/edit
Disallow: /*/*/issues/new
Disallow: /*/*/issues/*/edit
Disallow: /*/*/merge_requests/new
Disallow: /*/*/merge_requests/*.patch
Disallow: /*/*/merge_requests/*.diff
Disallow: /*/*/merge_requests/*/edit
Disallow: /*/*/merge_requests/*/diffs
Disallow: /*/*/
-/
merge_requests/new
Disallow: /*/*/
-/
merge_requests/*.patch
Disallow: /*/*/
-/
merge_requests/*.diff
Disallow: /*/*/
-/
merge_requests/*/edit
Disallow: /*/*/
-/
merge_requests/*/diffs
Disallow: /*/*/project_members/import
Disallow: /*/*/labels/new
Disallow: /*/*/labels/*/edit
...
...
spec/frontend/diffs/mock_data/merge_request_diffs.js
View file @
a8b6b632
...
...
@@ -8,7 +8,7 @@ export default [
short_commit_sha
:
'
de7a8f7f
'
,
version_path
:
'
/gnuwget/wget2/merge_requests/6/diffs?diff_id=37
'
,
compare_path
:
'
/gnuwget/wget2/merge_requests/6/diffs?diff_id=37&start_sha=de7a8f7f20c3ea2e0bef3ba01cfd41c21f6b4995
'
,
'
/gnuwget/wget2/
-/
merge_requests/6/diffs?diff_id=37&start_sha=de7a8f7f20c3ea2e0bef3ba01cfd41c21f6b4995
'
,
},
{
base_version_path
:
'
/gnuwget/wget2/merge_requests/6/diffs?diff_id=36
'
,
...
...
@@ -19,7 +19,7 @@ export default [
short_commit_sha
:
'
e78fc18f
'
,
version_path
:
'
/gnuwget/wget2/merge_requests/6/diffs?diff_id=36
'
,
compare_path
:
'
/gnuwget/wget2/merge_requests/6/diffs?diff_id=37&start_sha=e78fc18fa37acb2185c59ca94d4a964464feb50e
'
,
'
/gnuwget/wget2/
-/
merge_requests/6/diffs?diff_id=37&start_sha=e78fc18fa37acb2185c59ca94d4a964464feb50e
'
,
},
{
base_version_path
:
'
/gnuwget/wget2/merge_requests/6/diffs?diff_id=35
'
,
...
...
@@ -30,7 +30,7 @@ export default [
short_commit_sha
:
'
48da7e7e
'
,
version_path
:
'
/gnuwget/wget2/merge_requests/6/diffs?diff_id=35
'
,
compare_path
:
'
/gnuwget/wget2/merge_requests/6/diffs?diff_id=37&start_sha=48da7e7e9a99d41c852578bd9cb541ca4d864b3e
'
,
'
/gnuwget/wget2/
-/
merge_requests/6/diffs?diff_id=37&start_sha=48da7e7e9a99d41c852578bd9cb541ca4d864b3e
'
,
},
{
base_version_path
:
'
/gnuwget/wget2/merge_requests/6/diffs?diff_id=20
'
,
...
...
@@ -41,6 +41,6 @@ export default [
short_commit_sha
:
'
47bac2ed
'
,
version_path
:
'
/gnuwget/wget2/merge_requests/6/diffs?diff_id=20
'
,
compare_path
:
'
/gnuwget/wget2/merge_requests/6/diffs?diff_id=37&start_sha=47bac2ed972c5bee344c1cea159a22cd7f711dc0
'
,
'
/gnuwget/wget2/
-/
merge_requests/6/diffs?diff_id=37&start_sha=47bac2ed972c5bee344c1cea159a22cd7f711dc0
'
,
},
];
spec/frontend/notes/mock_data.js
View file @
a8b6b632
...
...
@@ -52,7 +52,7 @@ export const noteableDataMock = {
time_estimate
:
0
,
title
:
'
14
'
,
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_by_id
:
1
,
web_url
:
'
/gitlab-org/gitlab-foss/issues/26
'
,
...
...
@@ -101,8 +101,8 @@ export const individualNote = {
{
name
:
'
art
'
,
user
:
{
id
:
1
,
name
:
'
Root
'
,
username
:
'
root
'
}
},
],
toggle_award_path
:
'
/gitlab-org/gitlab-foss/notes/1390/toggle_award_emoji
'
,
noteable_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
'
,
note_url
:
'
/group/project/
-/
merge_requests/1#note_1
'
,
report_abuse_path
:
'
/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
'
,
...
...
@@ -161,8 +161,8 @@ export const note = {
},
],
toggle_award_path
:
'
/gitlab-org/gitlab-foss/notes/546/toggle_award_emoji
'
,
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
'
,
noteable_note_url
:
'
/group/project/
-/
merge_requests/1#note_1
'
,
report_abuse_path
:
'
/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
'
,
...
...
@@ -205,7 +205,7 @@ export const discussionMock = {
discussion_id
:
'
9e3bd2f71a01de45fd166e6719eb380ad9f270b1
'
,
emoji_awardable
:
true
,
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
'
,
report_abuse_path
:
'
/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 = {
emoji_awardable
:
true
,
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
:
'
/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
'
,
...
...
@@ -299,7 +299,7 @@ export const discussionMock = {
discussion_id
:
'
9e3bd2f71a01de45fd166e6719eb380ad9f270b1
'
,
emoji_awardable
:
true
,
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
'
,
report_abuse_path
:
'
/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 = {
can_create_note
:
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
'
,
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 = {
},
},
],
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
'
,
report_abuse_path
:
'
/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 = {
discussion_id
:
'
70d5c92a4039a36c70100c6691c18c27e4b0a790
'
,
emoji_awardable
:
true
,
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
'
,
report_abuse_path
:
'
/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 = {
discussion_id
:
'
a3ed36e29b1957efb3b68c53e2d7a2b24b1df052
'
,
emoji_awardable
:
true
,
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
'
,
report_abuse_path
:
'
/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 = {
emoji_awardable
:
true
,
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
:
'
/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
'
,
...
...
spec/frontend/performance_bar/components/request_selector_spec.js
View file @
a8b6b632
...
...
@@ -5,7 +5,7 @@ describe('request selector', () => {
const
requests
=
[
{
id
:
'
warningReq
'
,
url
:
'
https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/1/discussions.json
'
,
url
:
'
https://gitlab.com/gitlab-org/gitlab-foss/
-/
merge_requests/1/discussions.json
'
,
truncatedUrl
:
'
discussions.json
'
,
hasWarnings
:
true
,
},
...
...
spec/frontend/performance_bar/stores/performance_bar_store_spec.js
View file @
a8b6b632
...
...
@@ -15,14 +15,14 @@ describe('PerformanceBarStore', () => {
});
it
(
'
keeps the last two components of the path when the last component is numeric
'
,
()
=>
{
store
.
addRequest
(
'
id
'
,
'
https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/1
'
);
store
.
addRequest
(
'
id
'
,
'
https://gitlab.com/gitlab-org/gitlab-foss/
-/
merge_requests/1
'
);
expect
(
findUrl
(
'
id
'
)).
toEqual
(
'
merge_requests/1
'
);
});
it
(
'
uses the last component of the path
'
,
()
=>
{
store
.
addRequest
(
'
id
'
,
'
https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/1.json?serializer=widget
'
,
'
https://gitlab.com/gitlab-org/gitlab-foss/
-/
merge_requests/1.json?serializer=widget
'
,
);
expect
(
findUrl
(
'
id
'
)).
toEqual
(
'
1.json?serializer=widget
'
);
});
...
...
spec/helpers/award_emoji_helper_spec.rb
View file @
a8b6b632
...
...
@@ -51,7 +51,7 @@ describe AwardEmojiHelper do
it
'returns correct url'
do
@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
)
end
...
...
spec/helpers/events_helper_spec.rb
View file @
a8b6b632
...
...
@@ -116,7 +116,7 @@ describe EventsHelper do
it
'returns a merge request url'
do
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
spec/helpers/labels_helper_spec.rb
View file @
a8b6b632
...
...
@@ -78,13 +78,21 @@ describe LabelsHelper do
end
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
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
[
'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
context
'with a tooltip argument'
do
...
...
spec/javascripts/diffs/components/compare_versions_dropdown_spec.js
View file @
a8b6b632
...
...
@@ -9,7 +9,7 @@ const startVersion = { version_index: 4 };
const
mergeRequestVersion
=
{
version_path
:
'
123
'
,
};
const
baseVersionPath
=
'
/gnuwget/wget2/merge_requests/6/diffs?diff_id=37
'
;
const
baseVersionPath
=
'
/gnuwget/wget2/
-/
merge_requests/6/diffs?diff_id=37
'
;
describe
(
'
CompareVersionsDropdown
'
,
()
=>
{
let
wrapper
;
...
...
spec/javascripts/diffs/mock_data/diff_discussions.js
View file @
a8b6b632
...
...
@@ -59,9 +59,10 @@ export default {
report_abuse_path
:
'
/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-test%2Fmerge_requests%2F20%23note_1749&user_id=1
'
,
path
:
'
/gitlab-org/gitlab-test/notes/1749
'
,
noteable_note_url
:
'
http://localhost:3000/gitlab-org/gitlab-test/merge_requests/20#note_1749
'
,
noteable_note_url
:
'
http://localhost:3000/gitlab-org/gitlab-test/-/merge_requests/20#note_1749
'
,
resolve_path
:
'
/gitlab-org/gitlab-test/merge_requests/20/discussions/6b232e05bea388c6b043ccc243ba505faac04ea8/resolve
'
,
'
/gitlab-org/gitlab-test/
-/
merge_requests/20/discussions/6b232e05bea388c6b043ccc243ba505faac04ea8/resolve
'
,
resolve_with_issue_path
:
'
/gitlab-org/gitlab-test/issues/new?discussion_to_resolve=6b232e05bea388c6b043ccc243ba505faac04ea8&merge_request_to_resolve_discussions_of=20
'
,
},
...
...
@@ -111,9 +112,10 @@ export default {
report_abuse_path
:
'
/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-test%2Fmerge_requests%2F20%23note_1753&user_id=1
'
,
path
:
'
/gitlab-org/gitlab-test/notes/1753
'
,
noteable_note_url
:
'
http://localhost:3000/gitlab-org/gitlab-test/merge_requests/20#note_1753
'
,
noteable_note_url
:
'
http://localhost:3000/gitlab-org/gitlab-test/-/merge_requests/20#note_1753
'
,
resolve_path
:
'
/gitlab-org/gitlab-test/merge_requests/20/discussions/6b232e05bea388c6b043ccc243ba505faac04ea8/resolve
'
,
'
/gitlab-org/gitlab-test/
-/
merge_requests/20/discussions/6b232e05bea388c6b043ccc243ba505faac04ea8/resolve
'
,
resolve_with_issue_path
:
'
/gitlab-org/gitlab-test/issues/new?discussion_to_resolve=6b232e05bea388c6b043ccc243ba505faac04ea8&merge_request_to_resolve_discussions_of=20
'
,
},
...
...
@@ -153,9 +155,10 @@ export default {
report_abuse_path
:
'
/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-test%2Fmerge_requests%2F20%23note_1754&user_id=1
'
,
path
:
'
/gitlab-org/gitlab-test/notes/1754
'
,
noteable_note_url
:
'
http://localhost:3000/gitlab-org/gitlab-test/merge_requests/20#note_1754
'
,
noteable_note_url
:
'
http://localhost:3000/gitlab-org/gitlab-test/-/merge_requests/20#note_1754
'
,
resolve_path
:
'
/gitlab-org/gitlab-test/merge_requests/20/discussions/6b232e05bea388c6b043ccc243ba505faac04ea8/resolve
'
,
'
/gitlab-org/gitlab-test/
-/
merge_requests/20/discussions/6b232e05bea388c6b043ccc243ba505faac04ea8/resolve
'
,
resolve_with_issue_path
:
'
/gitlab-org/gitlab-test/issues/new?discussion_to_resolve=6b232e05bea388c6b043ccc243ba505faac04ea8&merge_request_to_resolve_discussions_of=20
'
,
},
...
...
@@ -195,9 +198,10 @@ export default {
report_abuse_path
:
'
/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-test%2Fmerge_requests%2F20%23note_1755&user_id=1
'
,
path
:
'
/gitlab-org/gitlab-test/notes/1755
'
,
noteable_note_url
:
'
http://localhost:3000/gitlab-org/gitlab-test/merge_requests/20#note_1755
'
,
noteable_note_url
:
'
http://localhost:3000/gitlab-org/gitlab-test/-/merge_requests/20#note_1755
'
,
resolve_path
:
'
/gitlab-org/gitlab-test/merge_requests/20/discussions/6b232e05bea388c6b043ccc243ba505faac04ea8/resolve
'
,
'
/gitlab-org/gitlab-test/
-/
merge_requests/20/discussions/6b232e05bea388c6b043ccc243ba505faac04ea8/resolve
'
,
resolve_with_issue_path
:
'
/gitlab-org/gitlab-test/issues/new?discussion_to_resolve=6b232e05bea388c6b043ccc243ba505faac04ea8&merge_request_to_resolve_discussions_of=20
'
,
},
...
...
@@ -237,9 +241,10 @@ export default {
report_abuse_path
:
'
/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-test%2Fmerge_requests%2F20%23note_1756&user_id=1
'
,
path
:
'
/gitlab-org/gitlab-test/notes/1756
'
,
noteable_note_url
:
'
http://localhost:3000/gitlab-org/gitlab-test/merge_requests/20#note_1756
'
,
noteable_note_url
:
'
http://localhost:3000/gitlab-org/gitlab-test/-/merge_requests/20#note_1756
'
,
resolve_path
:
'
/gitlab-org/gitlab-test/merge_requests/20/discussions/6b232e05bea388c6b043ccc243ba505faac04ea8/resolve
'
,
'
/gitlab-org/gitlab-test/
-/
merge_requests/20/discussions/6b232e05bea388c6b043ccc243ba505faac04ea8/resolve
'
,
resolve_with_issue_path
:
'
/gitlab-org/gitlab-test/issues/new?discussion_to_resolve=6b232e05bea388c6b043ccc243ba505faac04ea8&merge_request_to_resolve_discussions_of=20
'
,
},
...
...
@@ -248,7 +253,7 @@ export default {
resolvable
:
true
,
resolved
:
false
,
resolve_path
:
'
/gitlab-org/gitlab-test/merge_requests/20/discussions/6b232e05bea388c6b043ccc243ba505faac04ea8/resolve
'
,
'
/gitlab-org/gitlab-test/
-/
merge_requests/20/discussions/6b232e05bea388c6b043ccc243ba505faac04ea8/resolve
'
,
resolve_with_issue_path
:
'
/gitlab-org/gitlab-test/issues/new?discussion_to_resolve=6b232e05bea388c6b043ccc243ba505faac04ea8&merge_request_to_resolve_discussions_of=20
'
,
diff_file
:
{
...
...
spec/javascripts/ide/stores/modules/commit/actions_spec.js
View file @
a8b6b632
...
...
@@ -461,7 +461,7 @@ describe('IDE commit module actions', () => {
.
dispatch
(
'
commit/commitChanges
'
)
.
then
(()
=>
{
expect
(
visitUrl
).
toHaveBeenCalledWith
(
`webUrl/merge_requests/new?merge_request[source_branch]=
${
`webUrl/
-/
merge_requests/new?merge_request[source_branch]=
${
store
.
getters
[
'
commit/placeholderBranchName
'
]
}
&merge_request[target_branch]=master&nav_source=webide`
,
);
...
...
spec/javascripts/jobs/components/stages_dropdown_spec.js
View file @
a8b6b632
...
...
@@ -27,7 +27,7 @@ describe('Stages Dropdown', () => {
},
merge_request
:
{
iid
:
1234
,
path
:
'
/root/detached-merge-request-pipelines/merge_requests/1
'
,
path
:
'
/root/detached-merge-request-pipelines/
-/
merge_requests/1
'
,
title
:
'
Update README.md
'
,
source_branch
:
'
feature-1234
'
,
source_branch_path
:
'
/root/detached-merge-request-pipelines/branches/feature-1234
'
,
...
...
spec/javascripts/merge_request_spec.js
View file @
a8b6b632
...
...
@@ -17,7 +17,7 @@ describe('MergeRequest', function() {
mock
=
new
MockAdapter
(
axios
);
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
,
{});
this
.
merge
=
new
MergeRequest
();
...
...
@@ -75,7 +75,7 @@ describe('MergeRequest', function() {
setTimeout
(()
=>
{
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
:
{
description
:
'
- [ ] Task List Item
\n
- [ ]
\n
- [ ] Task List Item 2
\n
'
,
...
...
@@ -93,7 +93,9 @@ describe('MergeRequest', function() {
// eslint-disable-next-line jasmine/no-disabled-tests
xit
(
'
shows an error notification when tasklist update failed
'
,
done
=>
{
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
,
{});
$
(
'
.js-task-list-field
'
).
trigger
({
...
...
spec/javascripts/merge_request_tabs_spec.js
View file @
a8b6b632
...
...
@@ -146,53 +146,53 @@ describe('MergeRequestTabs', function() {
it
(
'
changes from commits
'
,
function
()
{
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
(
'
diffs
'
)).
toBe
(
'
/foo/bar/merge_requests/1/diffs
'
);
expect
(
this
.
subject
(
'
show
'
)).
toBe
(
'
/foo/bar/
-/
merge_requests/1
'
);
expect
(
this
.
subject
(
'
diffs
'
)).
toBe
(
'
/foo/bar/
-/
merge_requests/1/diffs
'
);
});
it
(
'
changes from diffs
'
,
function
()
{
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
(
'
commits
'
)).
toBe
(
'
/foo/bar/merge_requests/1/commits
'
);
expect
(
this
.
subject
(
'
show
'
)).
toBe
(
'
/foo/bar/
-/
merge_requests/1
'
);
expect
(
this
.
subject
(
'
commits
'
)).
toBe
(
'
/foo/bar/
-/
merge_requests/1/commits
'
);
});
it
(
'
changes from diffs.html
'
,
function
()
{
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
(
'
commits
'
)).
toBe
(
'
/foo/bar/merge_requests/1/commits
'
);
expect
(
this
.
subject
(
'
show
'
)).
toBe
(
'
/foo/bar/
-/
merge_requests/1
'
);
expect
(
this
.
subject
(
'
commits
'
)).
toBe
(
'
/foo/bar/
-/
merge_requests/1/commits
'
);
});
it
(
'
changes from notes
'
,
function
()
{
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
(
'
commits
'
)).
toBe
(
'
/foo/bar/merge_requests/1/commits
'
);
expect
(
this
.
subject
(
'
diffs
'
)).
toBe
(
'
/foo/bar/
-/
merge_requests/1/diffs
'
);
expect
(
this
.
subject
(
'
commits
'
)).
toBe
(
'
/foo/bar/
-/
merge_requests/1/commits
'
);
});
it
(
'
includes search parameters and hash string
'
,
function
()
{
setLocation
({
pathname
:
'
/foo/bar/merge_requests/1/diffs
'
,
pathname
:
'
/foo/bar/
-/
merge_requests/1/diffs
'
,
search
:
'
?view=parallel
'
,
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
()
{
setLocation
({
pathname
:
'
/foo/bar/merge_requests/1
'
,
pathname
:
'
/foo/bar/
-/
merge_requests/1
'
,
});
const
newState
=
this
.
subject
(
'
commits
'
);
...
...
@@ -207,10 +207,10 @@ describe('MergeRequestTabs', function() {
it
(
'
treats "show" like "notes"
'
,
function
()
{
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
'
);
});
});
...
...
spec/javascripts/notes/components/note_actions_spec.js
View file @
a8b6b632
...
...
@@ -29,7 +29,7 @@ describe('noteActions', () => {
canAwardEmoji
:
true
,
canReportAsAbuse
:
true
,
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`
,
showReply
:
false
,
};
...
...
spec/javascripts/search_autocomplete_spec.js
View file @
a8b6b632
...
...
@@ -18,11 +18,11 @@ describe('Search autocomplete dropdown', () => {
const
projectIssuesPath
=
'
/gitlab-org/gitlab-foss/issues
'
;
const
projectMRsPath
=
'
/gitlab-org/gitlab-foss/merge_requests
'
;
const
projectMRsPath
=
'
/gitlab-org/gitlab-foss/
-/
merge_requests
'
;
const
groupIssuesPath
=
'
/groups/gitlab-org/issues
'
;
const
groupIssuesPath
=
'
/groups/gitlab-org/
-/
issues
'
;
const
groupMRsPath
=
'
/groups/gitlab-org/merge_requests
'
;
const
groupMRsPath
=
'
/groups/gitlab-org/
-/
merge_requests
'
;
const
projectName
=
'
GitLab Community Edition
'
;
...
...
spec/javascripts/vue_mr_widget/mock_data.js
View file @
a8b6b632
...
...
@@ -146,7 +146,7 @@ export default {
},
merge_request
:
{
iid
:
1
,
path
:
'
/root/detached-merge-request-pipelines/merge_requests/1
'
,
path
:
'
/root/detached-merge-request-pipelines/
-/
merge_requests/1
'
,
title
:
'
Update README.md
'
,
source_branch
:
'
feature-1
'
,
source_branch_path
:
'
/root/detached-merge-request-pipelines/branches/feature-1
'
,
...
...
@@ -196,7 +196,7 @@ export default {
can_be_merged
:
true
,
has_ci
:
true
,
ci_status
:
'
success
'
,
pipeline_status_path
:
'
/root/acets-app/merge_requests/22/pipeline_status
'
,
pipeline_status_path
:
'
/root/acets-app/
-/
merge_requests/22/pipeline_status
'
,
issues_links
:
{
closing
:
''
,
mentioned_but_not_closing
:
''
,
...
...
@@ -209,30 +209,30 @@ export default {
},
target_branch_path
:
'
/root/acets-app/branches/master
'
,
source_branch_path
:
'
/root/acets-app/branches/daaaa
'
,
conflict_resolution_ui_path
:
'
/root/acets-app/merge_requests/22/conflicts
'
,
remove_wip_path
:
'
/root/acets-app/merge_requests/22/remove_wip
'
,
cancel_auto_merge_path
:
'
/root/acets-app/merge_requests/22/cancel_auto_merge
'
,
conflict_resolution_ui_path
:
'
/root/acets-app/
-/
merge_requests/22/conflicts
'
,
remove_wip_path
:
'
/root/acets-app/
-/
merge_requests/22/remove_wip
'
,
cancel_auto_merge_path
:
'
/root/acets-app/
-/
merge_requests/22/cancel_auto_merge
'
,
create_issue_to_resolve_discussions_path
:
'
/root/acets-app/issues/new?merge_request_to_resolve_discussions_of=22
'
,
merge_path
:
'
/root/acets-app/merge_requests/22/merge
'
,
merge_path
:
'
/root/acets-app/
-/
merge_requests/22/merge
'
,
cherry_pick_in_fork_path
:
'
/root/acets-app/forks?continue%5Bnotice%5D=You%27re+not+allowed+to+make+changes+to+this+project+directly.+A+fork+of+this+project+has+been+created+that+you+can+make+changes+in%2C+so+you+can+submit+a+merge+request.+Try+to+revert+this+commit+again.&continue%5Bnotice_now%5D=You%27re+not+allowed+to+make+changes+to+this+project+directly.+A+fork+of+this+project+is+being+created+that+you+can+make+changes+in%2C+so+you+can+submit+a+merge+request.&continue%5Bto%5D=%2Froot%2Facets-app%2Fmerge_requests%2F22&namespace_key=1
'
,
revert_in_fork_path
:
'
/root/acets-app/forks?continue%5Bnotice%5D=You%27re+not+allowed+to+make+changes+to+this+project+directly.+A+fork+of+this+project+has+been+created+that+you+can+make+changes+in%2C+so+you+can+submit+a+merge+request.+Try+to+cherry-pick+this+commit+again.&continue%5Bnotice_now%5D=You%27re+not+allowed+to+make+changes+to+this+project+directly.+A+fork+of+this+project+is+being+created+that+you+can+make+changes+in%2C+so+you+can+submit+a+merge+request.&continue%5Bto%5D=%2Froot%2Facets-app%2Fmerge_requests%2F22&namespace_key=1
'
,
email_patches_path
:
'
/root/acets-app/merge_requests/22.patch
'
,
plain_diff_path
:
'
/root/acets-app/merge_requests/22.diff
'
,
merge_request_basic_path
:
'
/root/acets-app/merge_requests/22.json?serializer=basic
'
,
merge_request_widget_path
:
'
/root/acets-app/merge_requests/22/widget.json
'
,
email_patches_path
:
'
/root/acets-app/
-/
merge_requests/22.patch
'
,
plain_diff_path
:
'
/root/acets-app/
-/
merge_requests/22.diff
'
,
merge_request_basic_path
:
'
/root/acets-app/
-/
merge_requests/22.json?serializer=basic
'
,
merge_request_widget_path
:
'
/root/acets-app/
-/
merge_requests/22/widget.json
'
,
merge_request_cached_widget_path
:
'
/cached.json
'
,
merge_check_path
:
'
/root/acets-app/merge_requests/22/merge_check
'
,
ci_environments_status_url
:
'
/root/acets-app/merge_requests/22/ci_environments_status
'
,
merge_check_path
:
'
/root/acets-app/
-/
merge_requests/22/merge_check
'
,
ci_environments_status_url
:
'
/root/acets-app/
-/
merge_requests/22/ci_environments_status
'
,
project_archived
:
false
,
default_merge_commit_message_with_description
:
"
Merge branch 'daaaa' into 'master'
\n\n
Update README.md
\n\n
See merge request !22
"
,
default_squash_commit_message
:
'
Test squash commit message
'
,
diverged_commits_count
:
0
,
only_allow_merge_if_pipeline_succeeds
:
false
,
commit_change_content_path
:
'
/root/acets-app/merge_requests/22/commit_change_content
'
,
commit_change_content_path
:
'
/root/acets-app/
-/
merge_requests/22/commit_change_content
'
,
merge_commit_path
:
'
http://localhost:3000/root/acets-app/commit/53027d060246c8f47e4a9310fb332aa52f221775
'
,
troubleshooting_docs_path
:
'
help
'
,
...
...
spec/lib/banzai/filter/repository_link_filter_spec.rb
View file @
a8b6b632
...
...
@@ -156,7 +156,7 @@ describe Banzai::Filter::RepositoryLinkFilter do
end
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
)
expect
(
doc
.
at_css
(
'a'
)[
'href'
]).
to
eq
path
...
...
spec/lib/gitlab/danger/helper_spec.rb
View file @
a8b6b632
...
...
@@ -335,14 +335,14 @@ describe Gitlab::Danger::Helper do
it
'returns false when on a normal merge request'
do
expect
(
fake_gitlab
).
to
receive
(
:mr_json
)
.
and_return
(
'web_url'
=>
'https://gitlab.com/gitlab-org/gitlab/merge_requests/1'
)
.
and_return
(
'web_url'
=>
'https://gitlab.com/gitlab-org/gitlab/
-/
merge_requests/1'
)
expect
(
helper
).
not_to
be_security_mr
end
it
'returns true when on a security merge request'
do
expect
(
fake_gitlab
).
to
receive
(
:mr_json
)
.
and_return
(
'web_url'
=>
'https://gitlab.com/gitlab-org/security/gitlab/merge_requests/1'
)
.
and_return
(
'web_url'
=>
'https://gitlab.com/gitlab-org/security/gitlab/
-/
merge_requests/1'
)
expect
(
helper
).
to
be_security_mr
end
...
...
spec/lib/gitlab/data_builder/pipeline_spec.rb
View file @
a8b6b632
...
...
@@ -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
[
:state
]).
to
eq
(
merge_request
.
state
)
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
...
...
spec/lib/gitlab/etag_caching/router_spec.rb
View file @
a8b6b632
...
...
@@ -68,7 +68,7 @@ describe Gitlab::EtagCaching::Router do
it
'matches new merge request pipelines endpoint'
do
result
=
described_class
.
match
(
'/my-group/my-project/merge_requests/new.json'
'/my-group/my-project/
-/
merge_requests/new.json'
)
expect
(
result
).
to
be_present
...
...
@@ -77,7 +77,7 @@ describe Gitlab::EtagCaching::Router do
it
'matches merge request pipelines endpoint'
do
result
=
described_class
.
match
(
'/my-group/my-project/merge_requests/234/pipelines.json'
'/my-group/my-project/
-/
merge_requests/234/pipelines.json'
)
expect
(
result
).
to
be_present
...
...
spec/lib/gitlab/internal_post_receive/response_spec.rb
View file @
a8b6b632
...
...
@@ -9,8 +9,8 @@ describe Gitlab::InternalPostReceive::Response do
context
'when there are urls_data'
do
it
'adds a message for each merge request URL'
do
urls_data
=
[
{
new_merge_request:
false
,
branch_name:
'foo'
,
url:
'http://example.com/foo/bar/merge_requests/1'
},
{
new_merge_request:
true
,
branch_name:
'bar'
,
url:
'http://example.com/foo/bar/merge_requests/new?merge_request%5Bsource_branch%5D=bar'
}
{
new_merge_request:
false
,
branch_name:
'foo'
,
url:
'http://example.com/foo/bar/
-/
merge_requests/1'
},
{
new_merge_request:
true
,
branch_name:
'bar'
,
url:
'http://example.com/foo/bar/
-/
merge_requests/new?merge_request%5Bsource_branch%5D=bar'
}
]
subject
.
add_merge_request_urls
(
urls_data
)
...
...
@@ -24,13 +24,13 @@ describe Gitlab::InternalPostReceive::Response do
describe
'#add_merge_request_url'
do
context
'when :new_merge_request is false'
do
it
'adds a basic message to view the existing merge request'
do
url_data
=
{
new_merge_request:
false
,
branch_name:
'foo'
,
url:
'http://example.com/foo/bar/merge_requests/1'
}
url_data
=
{
new_merge_request:
false
,
branch_name:
'foo'
,
url:
'http://example.com/foo/bar/
-/
merge_requests/1'
}
subject
.
add_merge_request_url
(
url_data
)
message
=
<<~
MESSAGE
.
strip
View merge request for foo:
http://example.com/foo/bar/merge_requests/1
http://example.com/foo/bar/
-/
merge_requests/1
MESSAGE
expect
(
subject
.
messages
.
first
.
message
).
to
eq
(
message
)
...
...
@@ -40,13 +40,13 @@ describe Gitlab::InternalPostReceive::Response do
context
'when :new_merge_request is true'
do
it
'adds a basic message to create a new merge request'
do
url_data
=
{
new_merge_request:
true
,
branch_name:
'bar'
,
url:
'http://example.com/foo/bar/merge_requests/new?merge_request%5Bsource_branch%5D=bar'
}
url_data
=
{
new_merge_request:
true
,
branch_name:
'bar'
,
url:
'http://example.com/foo/bar/
-/
merge_requests/new?merge_request%5Bsource_branch%5D=bar'
}
subject
.
add_merge_request_url
(
url_data
)
message
=
<<~
MESSAGE
.
strip
To create a merge request for bar, visit:
http://example.com/foo/bar/merge_requests/new?merge_request%5Bsource_branch%5D=bar
http://example.com/foo/bar/
-/
merge_requests/new?merge_request%5Bsource_branch%5D=bar
MESSAGE
expect
(
subject
.
messages
.
first
.
message
).
to
eq
(
message
)
...
...
spec/lib/gitlab/url_builder_spec.rb
View file @
a8b6b632
...
...
@@ -55,7 +55,7 @@ describe Gitlab::UrlBuilder do
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
...
...
@@ -118,7 +118,7 @@ describe Gitlab::UrlBuilder do
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
...
...
@@ -129,7 +129,7 @@ describe Gitlab::UrlBuilder do
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
...
...
spec/models/project_services/chat_message/merge_message_spec.rb
View file @
a8b6b632
...
...
@@ -52,7 +52,7 @@ describe ChatMessage::MergeMessage do
context
'open'
do
it
'returns a message regarding opening of merge requests'
do
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
end
end
...
...
@@ -63,7 +63,7 @@ describe ChatMessage::MergeMessage do
end
it
'returns a message regarding closing of merge requests'
do
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
end
end
...
...
@@ -77,12 +77,12 @@ describe ChatMessage::MergeMessage do
context
'open'
do
it
'returns a message regarding opening of merge requests'
do
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
.
activity
).
to
eq
({
title:
'Merge Request opened by Test User (test.user)'
,
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'
})
end
...
...
@@ -95,12 +95,12 @@ describe ChatMessage::MergeMessage do
it
'returns a message regarding closing of merge requests'
do
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
.
activity
).
to
eq
({
title:
'Merge Request closed by Test User (test.user)'
,
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'
})
end
...
...
spec/presenters/merge_request_presenter_spec.rb
View file @
a8b6b632
...
...
@@ -101,7 +101,7 @@ describe MergeRequestPresenter do
allow
(
presenter
).
to
receive_message_chain
(
:conflicts
,
:can_be_resolved_by?
).
with
(
user
)
{
true
}
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
...
...
@@ -179,7 +179,7 @@ describe MergeRequestPresenter do
it
'returns correct link with correct text'
do
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
.
to
match
(
"Assign yourself to this issue"
)
...
...
@@ -192,7 +192,7 @@ describe MergeRequestPresenter do
it
'returns correct link with correct text'
do
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
.
to
match
(
"Assign yourself to these issues"
)
...
...
@@ -221,7 +221,7 @@ describe MergeRequestPresenter do
.
with
(
user
)
.
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
...
...
@@ -248,7 +248,7 @@ describe MergeRequestPresenter do
.
and_return
(
true
)
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
...
...
@@ -312,7 +312,7 @@ describe MergeRequestPresenter do
project
.
add_maintainer
(
user
)
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
...
...
@@ -535,7 +535,7 @@ describe MergeRequestPresenter do
it
'returns path'
do
is_expected
.
to
eq
(
"/
#{
project
.
full_path
}
/merge_requests/
#{
resource
.
iid
}
/rebase"
)
.
to
eq
(
"/
#{
project
.
full_path
}
/
-/
merge_requests/
#{
resource
.
iid
}
/rebase"
)
end
end
...
...
spec/requests/api/internal/base_spec.rb
View file @
a8b6b632
...
...
@@ -858,7 +858,7 @@ describe API::Internal::Base do
message
=
<<~
MESSAGE
.
strip
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
expect
(
json_response
[
'messages'
]).
to
include
(
build_basic_message
(
message
))
...
...
@@ -921,7 +921,7 @@ describe API::Internal::Base do
message
=
<<~
MESSAGE
.
strip
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
expect
(
json_response
[
'messages'
]).
to
include
(
build_basic_message
(
message
))
...
...
spec/requests/api/releases_spec.rb
View file @
a8b6b632
...
...
@@ -76,7 +76,7 @@ describe API::Releases do
mr_uri
=
URI
.
parse
(
links
[
'merge_requests_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
(
mr_uri
.
query
).
to
eq
(
expected_query
)
expect
(
issue_uri
.
query
).
to
eq
(
expected_query
)
...
...
spec/requests/projects/merge_requests_discussions_spec.rb
View file @
a8b6b632
...
...
@@ -4,7 +4,7 @@ require 'spec_helper'
describe
'merge requests discussions'
do
# 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
(
:user
)
{
project
.
owner
}
let
(
:merge_request
)
{
create
(
:merge_request_with_diffs
,
target_project:
project
,
source_project:
project
)
}
...
...
spec/requests/user_activity_spec.rb
View file @
a8b6b632
...
...
@@ -26,8 +26,8 @@ describe 'Update of user activity' do
'/dashboard/todos'
,
'/group/project/issues'
,
'/group/project/issues/10'
,
'/group/project/merge_requests'
,
'/group/project/merge_requests/15'
'/group/project/
-/
merge_requests'
,
'/group/project/
-/
merge_requests/15'
]
context
'without an authenticated user'
do
...
...
spec/routing/project_routing_spec.rb
View file @
a8b6b632
...
...
@@ -292,26 +292,26 @@ describe 'project routing' do
describe
Projects
::
MergeRequestsController
,
'routing'
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
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
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'
,
namespace_id:
'gitlab'
,
project_id:
'gitlabhq'
,
id:
'1'
)
end
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.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/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.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/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/pipelines'
)).
to
route_to
(
'projects/merge_requests#show'
,
namespace_id:
'gitlab'
,
project_id:
'gitlabhq'
,
id:
'1'
,
tab:
'pipelines'
)
end
it
'to #show from scoped route'
do
...
...
@@ -323,46 +323,52 @@ describe 'project routing' do
it_behaves_like
'RESTful project resources'
do
let
(
:controller
)
{
'merge_requests'
}
let
(
:actions
)
{
[
:index
,
:edit
,
:show
,
:update
]
}
let
(
:controller_path
)
{
'/-/merge_requests'
}
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
describe
Projects
::
MergeRequests
::
CreationsController
,
'routing'
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/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'
)).
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/pipelines'
)).
to
route_to
(
'projects/merge_requests/creations#new'
,
namespace_id:
'gitlab'
,
project_id:
'gitlabhq'
,
tab:
'pipelines'
)
end
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
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
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
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
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
it_behaves_like
'redirecting a legacy project path'
,
"/gitlab/gitlabhq/merge_requests/new"
,
"/gitlab/gitlabhq/-/merge_requests/new"
end
describe
Projects
::
MergeRequests
::
DiffsController
,
'routing'
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
describe
Projects
::
MergeRequests
::
ConflictsController
,
'routing'
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
# raw_project_snippet GET /:project_id/snippets/:id/raw(.:format) snippets#raw
...
...
spec/serializers/merge_request_widget_entity_spec.rb
View file @
a8b6b632
...
...
@@ -45,12 +45,12 @@ describe MergeRequestWidgetEntity do
it
'has email_patches_path'
do
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
it
'has plain_diff_path'
do
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
describe
'when source project is deleted'
do
...
...
spec/serializers/paginated_diff_entity_spec.rb
View file @
a8b6b632
...
...
@@ -26,7 +26,7 @@ describe PaginatedDiffEntity do
expect
(
subject
[
:pagination
]).
to
eq
(
current_page:
2
,
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
)
end
...
...
spec/services/ci/expire_pipeline_cache_service_spec.rb
View file @
a8b6b632
...
...
@@ -11,7 +11,7 @@ describe Ci::ExpirePipelineCacheService do
describe
'#execute'
do
it
'invalidates Etag caching for project pipelines path'
do
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"
expect_any_instance_of
(
Gitlab
::
EtagCaching
::
Store
).
to
receive
(
:touch
).
with
(
pipelines_path
)
...
...
@@ -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
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_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
)
expect_any_instance_of
(
Gitlab
::
EtagCaching
::
Store
).
to
receive
(
:touch
).
with
(
merge_request_pipelines_path
)
...
...
spec/services/merge_requests/get_urls_service_spec.rb
View file @
a8b6b632
...
...
@@ -8,8 +8,8 @@ describe MergeRequests::GetUrlsService do
let
(
:project
)
{
create
(
:project
,
:public
,
:repository
)
}
let
(
:service
)
{
described_class
.
new
(
project
)
}
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
(
:show_merge_request_url
)
{
"http://
#{
Gitlab
.
config
.
gitlab
.
host
}
/
#{
project
.
full_path
}
/merge_requests/
#{
merge_request
.
iid
}
"
}
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
(
: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
(
:existing_branch_changes
)
{
"d14d6c0abdd253381df51a723d58691b2ee1ab08 570e7b2abdd848b95f2f578043fc23bd6f6fd24d refs/heads/
#{
source_branch
}
"
}
...
...
@@ -134,7 +134,7 @@ describe MergeRequests::GetUrlsService do
let
(
:new_branch_changes
)
{
"
#{
Gitlab
::
Git
::
BLANK_SHA
}
570e7b2abdd848b95f2f578043fc23bd6f6fd24d refs/heads/new_branch"
}
let
(
:existing_branch_changes
)
{
"d14d6c0abdd253381df51a723d58691b2ee1ab08 570e7b2abdd848b95f2f578043fc23bd6f6fd24d refs/heads/markdown"
}
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
result
=
service
.
execute
(
changes
)
...
...
spec/services/system_note_service_spec.rb
View file @
a8b6b632
...
...
@@ -314,7 +314,7 @@ describe SystemNoteService do
url
=
if
type
==
'commit'
"
#{
Settings
.
gitlab
.
base_url
}
/
#{
project
.
namespace
.
path
}
/
#{
project
.
path
}
/commit/
#{
commit
.
id
}
"
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
link
=
double
(
object:
{
'url'
=>
url
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment