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
7f833087
Commit
7f833087
authored
Dec 18, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add latest changes from gitlab-org/gitlab@master
parent
bbe24306
Changes
68
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
68 changed files
with
290 additions
and
336 deletions
+290
-336
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/assets/javascripts/repository/components/breadcrumbs.vue
app/assets/javascripts/repository/components/breadcrumbs.vue
+2
-2
app/assets/javascripts/repository/components/table/parent_row.vue
...ts/javascripts/repository/components/table/parent_row.vue
+1
-1
app/assets/javascripts/repository/components/table/row.vue
app/assets/javascripts/repository/components/table/row.vue
+1
-1
app/assets/javascripts/repository/router.js
app/assets/javascripts/repository/router.js
+1
-1
app/assets/javascripts/vue_shared/components/diff_viewer/diff_viewer.vue
...scripts/vue_shared/components/diff_viewer/diff_viewer.vue
+2
-2
app/helpers/submodule_helper.rb
app/helpers/submodule_helper.rb
+0
-2
app/helpers/tree_helper.rb
app/helpers/tree_helper.rb
+2
-2
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
changelogs/unreleased/dz-move-project-routes.yml
changelogs/unreleased/dz-move-project-routes.yml
+0
-5
changelogs/unreleased/dz-scope-repository-routes.yml
changelogs/unreleased/dz-scope-repository-routes.yml
+0
-5
config/routes/project.rb
config/routes/project.rb
+77
-78
config/routes/repository.rb
config/routes/repository.rb
+1
-1
lib/banzai/filter/relative_link_filter.rb
lib/banzai/filter/relative_link_filter.rb
+1
-8
lib/gitlab/dependency_linker/godeps_json_linker.rb
lib/gitlab/dependency_linker/godeps_json_linker.rb
+2
-4
lib/gitlab/middleware/go.rb
lib/gitlab/middleware/go.rb
+1
-1
locale/gitlab.pot
locale/gitlab.pot
+6
-0
spec/controllers/concerns/metrics_dashboard_spec.rb
spec/controllers/concerns/metrics_dashboard_spec.rb
+1
-1
spec/controllers/projects/blame_controller_spec.rb
spec/controllers/projects/blame_controller_spec.rb
+1
-1
spec/controllers/projects/blob_controller_spec.rb
spec/controllers/projects/blob_controller_spec.rb
+2
-2
spec/controllers/projects/branches_controller_spec.rb
spec/controllers/projects/branches_controller_spec.rb
+3
-3
spec/controllers/projects/raw_controller_spec.rb
spec/controllers/projects/raw_controller_spec.rb
+1
-1
spec/controllers/projects/tree_controller_spec.rb
spec/controllers/projects/tree_controller_spec.rb
+5
-5
spec/controllers/projects_controller_spec.rb
spec/controllers/projects_controller_spec.rb
+1
-1
spec/frontend/notes/mock_data.js
spec/frontend/notes/mock_data.js
+13
-13
spec/frontend/repository/components/table/parent_row_spec.js
spec/frontend/repository/components/table/parent_row_spec.js
+4
-4
spec/frontend/repository/components/table/row_spec.js
spec/frontend/repository/components/table/row_spec.js
+1
-1
spec/frontend/repository/router_spec.js
spec/frontend/repository/router_spec.js
+5
-5
spec/helpers/award_emoji_helper_spec.rb
spec/helpers/award_emoji_helper_spec.rb
+1
-1
spec/helpers/blob_helper_spec.rb
spec/helpers/blob_helper_spec.rb
+2
-2
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
+1
-9
spec/helpers/markup_helper_spec.rb
spec/helpers/markup_helper_spec.rb
+1
-1
spec/helpers/submodule_helper_spec.rb
spec/helpers/submodule_helper_spec.rb
+2
-2
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
+3
-5
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/vue_shared/components/diff_viewer/diff_viewer_spec.js
...pts/vue_shared/components/diff_viewer/diff_viewer_spec.js
+2
-2
spec/lib/banzai/filter/relative_link_filter_spec.rb
spec/lib/banzai/filter/relative_link_filter_spec.rb
+19
-19
spec/lib/gitlab/conflict/file_spec.rb
spec/lib/gitlab/conflict/file_spec.rb
+1
-1
spec/lib/gitlab/data_builder/pipeline_spec.rb
spec/lib/gitlab/data_builder/pipeline_spec.rb
+1
-1
spec/lib/gitlab/dependency_linker/godeps_json_linker_spec.rb
spec/lib/gitlab/dependency_linker/godeps_json_linker_spec.rb
+2
-2
spec/lib/gitlab/middleware/go_spec.rb
spec/lib/gitlab/middleware/go_spec.rb
+1
-1
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/models/project_spec.rb
spec/models/project_spec.rb
+1
-1
spec/presenters/blob_presenter_spec.rb
spec/presenters/blob_presenter_spec.rb
+1
-1
spec/presenters/merge_request_presenter_spec.rb
spec/presenters/merge_request_presenter_spec.rb
+11
-11
spec/presenters/tree_entry_presenter_spec.rb
spec/presenters/tree_entry_presenter_spec.rb
+1
-1
spec/requests/api/internal/base_spec.rb
spec/requests/api/internal/base_spec.rb
+2
-2
spec/requests/api/projects_spec.rb
spec/requests/api/projects_spec.rb
+1
-1
spec/requests/api/releases_spec.rb
spec/requests/api/releases_spec.rb
+1
-1
spec/requests/git_http_spec.rb
spec/requests/git_http_spec.rb
+2
-2
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
+43
-63
spec/serializers/blob_entity_spec.rb
spec/serializers/blob_entity_spec.rb
+1
-1
spec/serializers/merge_request_poll_widget_entity_spec.rb
spec/serializers/merge_request_poll_widget_entity_spec.rb
+1
-1
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
spec/views/help/index.html.haml_spec.rb
spec/views/help/index.html.haml_spec.rb
+1
-1
No files found.
app/assets/javascripts/ide/stores/utils.js
View file @
7f833087
...
...
@@ -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 @
7f833087
...
...
@@ -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/assets/javascripts/repository/components/breadcrumbs.vue
View file @
7f833087
...
...
@@ -104,10 +104,10 @@ export default {
return
acc
.
concat
({
name
,
path
,
to
:
`/
-/
tree/
${
this
.
ref
}${
path
}
`
,
to
:
`/tree/
${
this
.
ref
}${
path
}
`
,
});
},
[{
name
:
this
.
projectShortPath
,
path
:
'
/
'
,
to
:
`/
-/
tree/
${
this
.
ref
}
/`
}],
[{
name
:
this
.
projectShortPath
,
path
:
'
/
'
,
to
:
`/tree/
${
this
.
ref
}
/`
}],
);
},
canCreateMrFromFork
()
{
...
...
app/assets/javascripts/repository/components/table/parent_row.vue
View file @
7f833087
...
...
@@ -15,7 +15,7 @@ export default {
const
splitArray
=
this
.
path
.
split
(
'
/
'
);
splitArray
.
pop
();
return
{
path
:
`/
-/
tree/
${
this
.
commitRef
}
/
${
splitArray
.
join
(
'
/
'
)}
`
};
return
{
path
:
`/tree/
${
this
.
commitRef
}
/
${
splitArray
.
join
(
'
/
'
)}
`
};
},
},
methods
:
{
...
...
app/assets/javascripts/repository/components/table/row.vue
View file @
7f833087
...
...
@@ -84,7 +84,7 @@ export default {
},
computed
:
{
routerLinkTo
()
{
return
this
.
isFolder
?
{
path
:
`/
-/
tree/
${
this
.
ref
}
/
${
this
.
path
}
`
}
:
null
;
return
this
.
isFolder
?
{
path
:
`/tree/
${
this
.
ref
}
/
${
this
.
path
}
`
}
:
null
;
},
iconName
()
{
return
`fa-
${
getIconName
(
this
.
type
,
this
.
path
)}
`
;
...
...
app/assets/javascripts/repository/router.js
View file @
7f833087
...
...
@@ -12,7 +12,7 @@ export default function createRouter(base, baseRef) {
base
:
joinPaths
(
gon
.
relative_url_root
||
''
,
base
),
routes
:
[
{
path
:
`/
-/
tree/
${
baseRef
}
(/.*)?`
,
path
:
`/tree/
${
baseRef
}
(/.*)?`
,
name
:
'
treePath
'
,
component
:
TreePage
,
props
:
route
=>
({
...
...
app/assets/javascripts/vue_shared/components/diff_viewer/diff_viewer.vue
View file @
7f833087
...
...
@@ -79,10 +79,10 @@ export default {
return
this
.
projectPath
.
indexOf
(
'
/
'
)
===
0
?
''
:
`
${
gon
.
relative_url_root
}
/`
;
},
fullOldPath
()
{
return
`
${
this
.
basePath
}${
this
.
projectPath
}
/
-/
raw/
${
this
.
oldSha
}
/
${
this
.
oldPath
}
`
;
return
`
${
this
.
basePath
}${
this
.
projectPath
}
/raw/
${
this
.
oldSha
}
/
${
this
.
oldPath
}
`
;
},
fullNewPath
()
{
return
`
${
this
.
basePath
}${
this
.
projectPath
}
/
-/
raw/
${
this
.
newSha
}
/
${
this
.
newPath
}
`
;
return
`
${
this
.
basePath
}${
this
.
projectPath
}
/raw/
${
this
.
newSha
}
/
${
this
.
newPath
}
`
;
},
},
};
...
...
app/helpers/submodule_helper.rb
View file @
7f833087
...
...
@@ -43,8 +43,6 @@ module SubmoduleHelper
elsif
github_dot_com_url?
(
url
)
standard_links
(
'github.com'
,
namespace
,
project
,
submodule_item_id
)
elsif
gitlab_dot_com_url?
(
url
)
# This need to be replaced with /-/tree routing once one is landed on
# GitLab.com. Issue https://gitlab.com/gitlab-org/gitlab/issues/42764
standard_links
(
'gitlab.com'
,
namespace
,
project
,
submodule_item_id
)
else
[
sanitize_submodule_url
(
url
),
nil
]
...
...
app/helpers/tree_helper.rb
View file @
7f833087
...
...
@@ -38,13 +38,13 @@ module TreeHelper
# many paths, as with a repository tree that has thousands of items.
def
fast_project_blob_path
(
project
,
blob_path
)
ActionDispatch
::
Journey
::
Router
::
Utils
.
escape_path
(
File
.
join
(
relative_url_root
,
project
.
path_with_namespace
,
'
-'
,
'
blob'
,
blob_path
)
File
.
join
(
relative_url_root
,
project
.
path_with_namespace
,
'blob'
,
blob_path
)
)
end
def
fast_project_tree_path
(
project
,
tree_path
)
ActionDispatch
::
Journey
::
Router
::
Utils
.
escape_path
(
File
.
join
(
relative_url_root
,
project
.
path_with_namespace
,
'
-'
,
'
tree'
,
tree_path
)
File
.
join
(
relative_url_root
,
project
.
path_with_namespace
,
'tree'
,
tree_path
)
)
end
...
...
app/models/project_services/chat_message/merge_message.rb
View file @
7f833087
...
...
@@ -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 @
7f833087
...
...
@@ -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>"
]
...
...
changelogs/unreleased/dz-move-project-routes.yml
deleted
100644 → 0
View file @
bbe24306
---
title
:
Move merge request routes under /-/ scope
merge_request
:
21126
author
:
type
:
deprecated
changelogs/unreleased/dz-scope-repository-routes.yml
deleted
100644 → 0
View file @
bbe24306
---
title
:
Move repository routes under - scope
merge_request
:
20455
author
:
type
:
deprecated
config/routes/project.rb
View file @
7f833087
...
...
@@ -271,82 +271,6 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
end
end
resources
:merge_requests
,
concerns: :awardable
,
except:
[
:new
,
:create
,
:show
],
constraints:
{
id:
/\d+/
}
do
member
do
get
:show
# Insert this first to ensure redirections using merge_requests#show match this route
get
:commit_change_content
post
:merge
post
:cancel_auto_merge
get
:pipeline_status
get
:ci_environments_status
post
:toggle_subscription
post
:remove_wip
post
:assign_related_issues
get
:discussions
,
format: :json
post
:rebase
get
:test_reports
get
:exposed_artifacts
scope
constraints:
->
(
req
)
{
req
.
format
==
:json
},
as: :json
do
get
:commits
get
:pipelines
get
:diffs
,
to:
'merge_requests/diffs#show'
get
:diffs_batch
,
to:
'merge_requests/diffs#diffs_batch'
get
:diffs_metadata
,
to:
'merge_requests/diffs#diffs_metadata'
get
:widget
,
to:
'merge_requests/content#widget'
get
:cached_widget
,
to:
'merge_requests/content#cached_widget'
end
scope
action: :show
do
get
:commits
,
defaults:
{
tab:
'commits'
}
get
:pipelines
,
defaults:
{
tab:
'pipelines'
}
get
:diffs
,
defaults:
{
tab:
'diffs'
}
end
get
:diff_for_path
,
controller:
'merge_requests/diffs'
scope
controller:
'merge_requests/conflicts'
do
get
:conflicts
,
action: :show
get
:conflict_for_path
post
:resolve_conflicts
end
end
collection
do
get
:diff_for_path
post
:bulk_update
end
resources
:discussions
,
only:
[
:show
],
constraints:
{
id:
/\h{40}/
}
do
member
do
post
:resolve
delete
:resolve
,
action: :unresolve
end
end
end
scope
path:
'merge_requests'
,
controller:
'merge_requests/creations'
do
post
''
,
action: :create
,
as:
nil
scope
path:
'new'
,
as: :new_merge_request
do
get
''
,
action: :new
scope
constraints:
->
(
req
)
{
req
.
format
==
:json
},
as: :json
do
get
:diffs
get
:pipelines
end
scope
action: :new
do
get
:diffs
,
defaults:
{
tab:
'diffs'
}
get
:pipelines
,
defaults:
{
tab:
'pipelines'
}
end
get
:diff_for_path
get
:branch_from
get
:branch_to
end
end
# The wiki routing contains wildcard characters so
# its preferable to keep it below all other project routes
draw
:wiki
...
...
@@ -404,6 +328,82 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
end
end
resources
:merge_requests
,
concerns: :awardable
,
except:
[
:new
,
:create
,
:show
],
constraints:
{
id:
/\d+/
}
do
member
do
get
:show
# Insert this first to ensure redirections using merge_requests#show match this route
get
:commit_change_content
post
:merge
post
:cancel_auto_merge
get
:pipeline_status
get
:ci_environments_status
post
:toggle_subscription
post
:remove_wip
post
:assign_related_issues
get
:discussions
,
format: :json
post
:rebase
get
:test_reports
get
:exposed_artifacts
scope
constraints:
->
(
req
)
{
req
.
format
==
:json
},
as: :json
do
get
:commits
get
:pipelines
get
:diffs
,
to:
'merge_requests/diffs#show'
get
:diffs_batch
,
to:
'merge_requests/diffs#diffs_batch'
get
:diffs_metadata
,
to:
'merge_requests/diffs#diffs_metadata'
get
:widget
,
to:
'merge_requests/content#widget'
get
:cached_widget
,
to:
'merge_requests/content#cached_widget'
end
scope
action: :show
do
get
:commits
,
defaults:
{
tab:
'commits'
}
get
:pipelines
,
defaults:
{
tab:
'pipelines'
}
get
:diffs
,
defaults:
{
tab:
'diffs'
}
end
get
:diff_for_path
,
controller:
'merge_requests/diffs'
scope
controller:
'merge_requests/conflicts'
do
get
:conflicts
,
action: :show
get
:conflict_for_path
post
:resolve_conflicts
end
end
collection
do
get
:diff_for_path
post
:bulk_update
end
resources
:discussions
,
only:
[
:show
],
constraints:
{
id:
/\h{40}/
}
do
member
do
post
:resolve
delete
:resolve
,
action: :unresolve
end
end
end
scope
path:
'merge_requests'
,
controller:
'merge_requests/creations'
do
post
''
,
action: :create
,
as:
nil
scope
path:
'new'
,
as: :new_merge_request
do
get
''
,
action: :new
scope
constraints:
->
(
req
)
{
req
.
format
==
:json
},
as: :json
do
get
:diffs
get
:pipelines
end
scope
action: :new
do
get
:diffs
,
defaults:
{
tab:
'diffs'
}
get
:pipelines
,
defaults:
{
tab:
'pipelines'
}
end
get
:diff_for_path
get
:branch_from
get
:branch_to
end
end
resources
:pipelines
,
only:
[
:index
,
:new
,
:create
,
:show
]
do
collection
do
resource
:pipelines_settings
,
path:
'settings'
,
only:
[
:show
,
:update
]
...
...
@@ -557,8 +557,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
,
:merge_requests
,
:blob
,
:tree
,
:raw
,
:blame
,
:commits
,
:create_dir
,
:find_file
,
:files
)
:serverless
,
:clusters
,
:audit_events
,
:wikis
)
end
# rubocop: disable Cop/PutProjectRoutesUnderScope
...
...
config/routes/repository.rb
View file @
7f833087
...
...
@@ -65,7 +65,7 @@ scope format: false do
resources
:protected_tags
,
only:
[
:index
,
:show
,
:create
,
:update
,
:destroy
]
end
scope
path:
'-'
,
constraints:
{
id:
/[^\0]+/
}
do
scope
constraints:
{
id:
/[^\0]+/
}
do
scope
controller: :blob
do
get
'/new/*id'
,
action: :new
,
as: :new_blob
post
'/create/*id'
,
action: :create
,
as: :create_blob
...
...
lib/banzai/filter/relative_link_filter.rb
View file @
7f833087
...
...
@@ -152,18 +152,11 @@ module Banzai
def
rebuild_relative_uri
(
uri
)
file_path
=
nested_file_path_if_exists
(
uri
)
resource_type
=
uri_type
(
file_path
)
# Repository routes are under /-/ scope now.
# Since we craft a path without using route helpers we must
# ensure - is added here.
prefix
=
'-'
if
%w(tree blob raw commits)
.
include?
(
resource_type
.
to_s
)
uri
.
path
=
[
relative_url_root
,
project
.
full_path
,
prefix
,
resource_type
,
uri_type
(
file_path
),
Addressable
::
URI
.
escape
(
ref
).
gsub
(
'#'
,
'%23'
),
Addressable
::
URI
.
escape
(
file_path
)
].
compact
.
join
(
'/'
).
squeeze
(
'/'
).
chomp
(
'/'
)
...
...
lib/gitlab/dependency_linker/godeps_json_linker.rb
View file @
7f833087
...
...
@@ -12,12 +12,10 @@ module Gitlab
def
link_dependencies
link_json
(
'ImportPath'
)
do
|
path
|
case
path
when
%r{
\A
(?<repo>github
\.
com/
#{
REPO_REGEX
}
)/(?<path>.+)
\z
}
"https://
#{
$~
[
:repo
]
}
/tree/master/
#{
$~
[
:path
]
}
"
when
%r{
\A
(?<repo>gitlab
\.
com/
#{
NESTED_REPO_REGEX
}
)
\.
git/(?<path>.+)
\z
}
,
%r{
\A
(?<repo>gitlab
\.
com/
#{
REPO_REGEX
}
)/(?<path>.+)
\z
}
%r{
\A
(?<repo>git(lab|hub)
\.
com/
#{
REPO_REGEX
}
)/(?<path>.+)
\z
}
"https://
#{
$~
[
:repo
]
}
/
-/
tree/master/
#{
$~
[
:path
]
}
"
"https://
#{
$~
[
:repo
]
}
/tree/master/
#{
$~
[
:path
]
}
"
when
/\Agolang\.org/
"https://godoc.org/
#{
path
}
"
else
...
...
lib/gitlab/middleware/go.rb
View file @
7f833087
...
...
@@ -60,7 +60,7 @@ module Gitlab
end
meta_import_tag
=
tag
:meta
,
name:
'go-import'
,
content:
"
#{
import_prefix
}
git
#{
repository_url
}
"
meta_source_tag
=
tag
:meta
,
name:
'go-source'
,
content:
"
#{
import_prefix
}
#{
project_url
}
#{
project_url
}
/
-/tree/
#{
branch
}
{/dir}
#{
project_url
}
/-
/blob/
#{
branch
}
{/dir}/{file}#L{line}"
meta_source_tag
=
tag
:meta
,
name:
'go-source'
,
content:
"
#{
import_prefix
}
#{
project_url
}
#{
project_url
}
/
tree/
#{
branch
}
{/dir}
#{
project_url
}
/blob/
#{
branch
}
{/dir}/{file}#L{line}"
head_tag
=
content_tag
:head
,
meta_import_tag
+
meta_source_tag
html_tag
=
content_tag
:html
,
head_tag
+
body_tag
[
html_tag
,
200
]
...
...
locale/gitlab.pot
View file @
7f833087
...
...
@@ -13328,6 +13328,9 @@ msgstr ""
msgid "ProductivityAanalytics|Merge requests"
msgstr ""
msgid "ProductivityAanalytics|is earlier than the allowed minimum date"
msgstr ""
msgid "ProductivityAnalytics|Ascending"
msgstr ""
...
...
@@ -13361,6 +13364,9 @@ msgstr ""
msgid "ProductivityAnalytics|Trendline"
msgstr ""
msgid "ProductivityAnalytics|is earlier than the given merged at after date"
msgstr ""
msgid "Profile"
msgstr ""
...
...
spec/controllers/concerns/metrics_dashboard_spec.rb
View file @
7f833087
...
...
@@ -72,7 +72,7 @@ describe MetricsDashboard do
it
'includes project_blob_path only for project dashboards'
do
expect
(
system_dashboard
[
'project_blob_path'
]).
to
be_nil
expect
(
project_dashboard
[
'project_blob_path'
]).
to
eq
(
"/
#{
project
.
namespace
.
path
}
/
#{
project
.
name
}
/
-/
blob/master/.gitlab/dashboards/test.yml"
)
expect
(
project_dashboard
[
'project_blob_path'
]).
to
eq
(
"/
#{
project
.
namespace
.
path
}
/
#{
project
.
name
}
/blob/master/.gitlab/dashboards/test.yml"
)
end
describe
'project permissions'
do
...
...
spec/controllers/projects/blame_controller_spec.rb
View file @
7f833087
...
...
@@ -36,7 +36,7 @@ describe Projects::BlameController do
it
'redirects'
do
expect
(
subject
)
.
to
redirect_to
(
"/
#{
project
.
full_path
}
/
-/
tree/master"
)
.
to
redirect_to
(
"/
#{
project
.
full_path
}
/tree/master"
)
end
end
...
...
spec/controllers/projects/blob_controller_spec.rb
View file @
7f833087
...
...
@@ -33,7 +33,7 @@ describe Projects::BlobController do
it
'redirects'
do
expect
(
subject
)
.
to
redirect_to
(
"/
#{
project
.
full_path
}
/
-/
tree/master"
)
.
to
redirect_to
(
"/
#{
project
.
full_path
}
/tree/master"
)
end
end
...
...
@@ -115,7 +115,7 @@ describe Projects::BlobController do
it
'redirects'
do
expect
(
subject
)
.
to
redirect_to
(
"/
#{
project
.
full_path
}
/
-/
tree/markdown/doc"
)
.
to
redirect_to
(
"/
#{
project
.
full_path
}
/tree/markdown/doc"
)
end
end
end
...
...
spec/controllers/projects/branches_controller_spec.rb
View file @
7f833087
...
...
@@ -37,7 +37,7 @@ describe Projects::BranchesController do
let
(
:ref
)
{
"master"
}
it
'redirects'
do
expect
(
subject
)
.
to
redirect_to
(
"/
#{
project
.
full_path
}
/
-/
tree/merge_branch"
)
.
to
redirect_to
(
"/
#{
project
.
full_path
}
/tree/merge_branch"
)
end
end
...
...
@@ -46,7 +46,7 @@ describe Projects::BranchesController do
let
(
:ref
)
{
"master"
}
it
'redirects'
do
expect
(
subject
)
.
to
redirect_to
(
"/
#{
project
.
full_path
}
/
-/
tree/alert('merge');"
)
.
to
redirect_to
(
"/
#{
project
.
full_path
}
/tree/alert('merge');"
)
end
end
...
...
@@ -88,7 +88,7 @@ describe Projects::BranchesController do
}
expect
(
subject
)
.
to
redirect_to
(
"/
#{
project
.
full_path
}
/
-/
tree/1-feature-branch"
)
.
to
redirect_to
(
"/
#{
project
.
full_path
}
/tree/1-feature-branch"
)
end
it
'posts a system note'
do
...
...
spec/controllers/projects/raw_controller_spec.rb
View file @
7f833087
...
...
@@ -69,7 +69,7 @@ describe Projects::RawController do
env: :raw_blob_request_limit
,
remote_ip:
'0.0.0.0'
,
request_method:
'GET'
,
path:
"/
#{
project
.
full_path
}
/
-/
raw/
#{
file_path
}
"
path:
"/
#{
project
.
full_path
}
/raw/
#{
file_path
}
"
}
expect
(
Gitlab
::
AuthLogger
).
to
receive
(
:error
).
with
(
attributes
).
once
...
...
spec/controllers/projects/tree_controller_spec.rb
View file @
7f833087
...
...
@@ -45,7 +45,7 @@ describe Projects::TreeController do
it
'redirects'
do
expect
(
subject
)
.
to
redirect_to
(
"/
#{
project
.
full_path
}
/
-/
tree/master"
)
.
to
redirect_to
(
"/
#{
project
.
full_path
}
/tree/master"
)
end
end
...
...
@@ -60,7 +60,7 @@ describe Projects::TreeController do
it
'redirects'
do
expect
(
subject
)
.
to
redirect_to
(
"/
#{
project
.
full_path
}
/
-/
tree/empty-branch"
)
.
to
redirect_to
(
"/
#{
project
.
full_path
}
/tree/empty-branch"
)
end
end
...
...
@@ -125,7 +125,7 @@ describe Projects::TreeController do
let
(
:id
)
{
'master/README.md'
}
it
'redirects'
do
redirect_url
=
"/
#{
project
.
full_path
}
/
-/
blob/master/README.md"
redirect_url
=
"/
#{
project
.
full_path
}
/blob/master/README.md"
expect
(
subject
)
.
to
redirect_to
(
redirect_url
)
end
...
...
@@ -153,7 +153,7 @@ describe Projects::TreeController do
it
'redirects to the new directory'
do
expect
(
subject
)
.
to
redirect_to
(
"/
#{
project
.
full_path
}
/
-/
tree/
#{
branch_name
}
/
#{
path
}
"
)
.
to
redirect_to
(
"/
#{
project
.
full_path
}
/tree/
#{
branch_name
}
/
#{
path
}
"
)
expect
(
flash
[
:notice
]).
to
eq
(
'The directory has been successfully created.'
)
end
end
...
...
@@ -164,7 +164,7 @@ describe Projects::TreeController do
it
'does not allow overwriting of existing files'
do
expect
(
subject
)
.
to
redirect_to
(
"/
#{
project
.
full_path
}
/
-/
tree/master"
)
.
to
redirect_to
(
"/
#{
project
.
full_path
}
/tree/master"
)
expect
(
flash
[
:alert
]).
to
eq
(
'A file with this name already exists'
)
end
end
...
...
spec/controllers/projects_controller_spec.rb
View file @
7f833087
...
...
@@ -943,7 +943,7 @@ describe ProjectsController do
end
it
'renders JSON body with image links expanded'
do
expanded_path
=
"/
#{
project_with_repo
.
full_path
}
/
-/
raw/master/files/images/logo-white.png"
expanded_path
=
"/
#{
project_with_repo
.
full_path
}
/raw/master/files/images/logo-white.png"
post
:preview_markdown
,
params:
preview_markdown_params
...
...
spec/frontend/notes/mock_data.js
View file @
7f833087
...
...
@@ -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/repository/components/table/parent_row_spec.js
View file @
7f833087
...
...
@@ -30,8 +30,8 @@ describe('Repository parent row component', () => {
it
.
each
`
path | to
${
'
app
'
}
|
${
'
/
-/
tree/master/
'
}
${
'
app/assets
'
}
|
${
'
/
-/
tree/master/app
'
}
${
'
app
'
}
|
${
'
/tree/master/
'
}
${
'
app/assets
'
}
|
${
'
/tree/master/app
'
}
`
(
'
renders link in $path to $to
'
,
({
path
,
to
})
=>
{
factory
(
path
);
...
...
@@ -46,7 +46,7 @@ describe('Repository parent row component', () => {
vm
.
find
(
'
td
'
).
trigger
(
'
click
'
);
expect
(
$router
.
push
).
toHaveBeenCalledWith
({
path
:
'
/
-/
tree/master/app
'
,
path
:
'
/tree/master/app
'
,
});
});
...
...
@@ -58,7 +58,7 @@ describe('Repository parent row component', () => {
vm
.
find
(
'
a
'
).
trigger
(
'
click
'
);
expect
(
$router
.
push
).
not
.
toHaveBeenCalledWith
({
path
:
'
/
-/
tree/master/app
'
,
path
:
'
/tree/master/app
'
,
});
});
});
spec/frontend/repository/components/table/row_spec.js
View file @
7f833087
...
...
@@ -83,7 +83,7 @@ describe('Repository table row component', () => {
vm
.
trigger
(
'
click
'
);
if
(
pushes
)
{
expect
(
$router
.
push
).
toHaveBeenCalledWith
({
path
:
'
/
-/
tree/master/test
'
});
expect
(
$router
.
push
).
toHaveBeenCalledWith
({
path
:
'
/tree/master/test
'
});
}
else
{
expect
(
$router
.
push
).
not
.
toHaveBeenCalled
();
}
...
...
spec/frontend/repository/router_spec.js
View file @
7f833087
...
...
@@ -4,11 +4,11 @@ import createRouter from '~/repository/router';
describe
(
'
Repository router spec
'
,
()
=>
{
it
.
each
`
path
| component | componentName
${
'
/
'
}
|
${
IndexPage
}
|
${
'
IndexPage
'
}
${
'
/
-/
tree/master
'
}
|
${
TreePage
}
|
${
'
TreePage
'
}
${
'
/
-/
tree/master/app/assets
'
}
|
${
TreePage
}
|
${
'
TreePage
'
}
${
'
/
-/
tree/123/app/assets
'
}
|
${
null
}
|
${
'
null
'
}
path | component | componentName
${
'
/
'
}
|
${
IndexPage
}
|
${
'
IndexPage
'
}
${
'
/tree/master
'
}
|
${
TreePage
}
|
${
'
TreePage
'
}
${
'
/tree/master/app/assets
'
}
|
${
TreePage
}
|
${
'
TreePage
'
}
${
'
/tree/123/app/assets
'
}
|
${
null
}
|
${
'
null
'
}
`
(
'
sets component as $componentName for path "$path"
'
,
({
path
,
component
})
=>
{
const
router
=
createRouter
(
''
,
'
master
'
);
...
...
spec/helpers/award_emoji_helper_spec.rb
View file @
7f833087
...
...
@@ -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/blob_helper_spec.rb
View file @
7f833087
...
...
@@ -56,7 +56,7 @@ describe BlobHelper do
stub_feature_flags
(
web_ide_default:
false
)
link
=
helper
.
edit_blob_button
(
project
,
'master'
,
'README.md'
)
expect
(
Capybara
.
string
(
link
).
find_link
(
'Edit'
)[
:href
]).
to
eq
(
"/
#{
project
.
full_path
}
/
-/
edit/master/README.md"
)
expect
(
Capybara
.
string
(
link
).
find_link
(
'Edit'
)[
:href
]).
to
eq
(
"/
#{
project
.
full_path
}
/edit/master/README.md"
)
end
it
'returns a link with a Web IDE route'
do
...
...
@@ -69,7 +69,7 @@ describe BlobHelper do
stub_feature_flags
(
web_ide_default:
false
)
link
=
helper
.
edit_blob_button
(
project
,
'master'
,
'README.md'
,
link_opts:
{
mr_id:
10
})
expect
(
Capybara
.
string
(
link
).
find_link
(
'Edit'
)[
:href
]).
to
eq
(
"/
#{
project
.
full_path
}
/
-/
edit/master/README.md?mr_id=10"
)
expect
(
Capybara
.
string
(
link
).
find_link
(
'Edit'
)[
:href
]).
to
eq
(
"/
#{
project
.
full_path
}
/edit/master/README.md?mr_id=10"
)
end
end
...
...
spec/helpers/events_helper_spec.rb
View file @
7f833087
...
...
@@ -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 @
7f833087
...
...
@@ -78,21 +78,13 @@ describe LabelsHelper do
end
context
'with a type argument'
do
[
'issue'
,
:issue
].
each
do
|
type
|
[
'issue'
,
:issue
,
'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
[
'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/helpers/markup_helper_spec.rb
View file @
7f833087
...
...
@@ -103,7 +103,7 @@ describe MarkupHelper do
let
(
:requested_path
)
{
'files/images/README.md'
}
it
'returns the correct HTML for the image'
do
expanded_path
=
"/
#{
project
.
full_path
}
/
-/
raw/master/files/images/
#{
image_file
}
"
expanded_path
=
"/
#{
project
.
full_path
}
/raw/master/files/images/
#{
image_file
}
"
expect
(
subject
.
css
(
'a'
)[
0
].
attr
(
'href'
)).
to
eq
(
expanded_path
)
expect
(
subject
.
css
(
'img'
)[
0
].
attr
(
'data-src'
)).
to
eq
(
expanded_path
)
...
...
spec/helpers/submodule_helper_spec.rb
View file @
7f833087
...
...
@@ -95,7 +95,7 @@ describe SubmoduleHelper do
allow
(
repo
).
to
receive
(
:project
).
and_return
(
project
)
stub_url
(
'./'
)
expect
(
subject
).
to
eq
([
"/master-project/
#{
project
.
path
}
"
,
"/master-project/
#{
project
.
path
}
/
-/
tree/hash"
])
expect
(
subject
).
to
eq
([
"/master-project/
#{
project
.
path
}
"
,
"/master-project/
#{
project
.
path
}
/tree/hash"
])
end
end
...
...
@@ -166,7 +166,7 @@ describe SubmoduleHelper do
allow
(
repo
).
to
receive
(
:submodule_url_for
).
and_return
(
relative_path
)
result
=
subject
expect
(
result
).
to
eq
([
expected_path
,
"
#{
expected_path
}
/
-/
tree/
#{
submodule_item
.
id
}
"
])
expect
(
result
).
to
eq
([
expected_path
,
"
#{
expected_path
}
/tree/
#{
submodule_item
.
id
}
"
])
end
it
'handles project under same group'
do
...
...
spec/javascripts/ide/stores/modules/commit/actions_spec.js
View file @
7f833087
...
...
@@ -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 @
7f833087
...
...
@@ -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 @
7f833087
...
...
@@ -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,9 +93,7 @@ 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 @
7f833087
...
...
@@ -147,53 +147,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
'
);
...
...
@@ -208,10 +208,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 @
7f833087
...
...
@@ -30,7 +30,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/vue_shared/components/diff_viewer/diff_viewer_spec.js
View file @
7f833087
...
...
@@ -38,11 +38,11 @@ describe('DiffViewer', () => {
setTimeout
(()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.deleted img
'
).
getAttribute
(
'
src
'
)).
toBe
(
`//
-/
raw/DEF/
${
RED_BOX_IMAGE_URL
}
`
,
`//raw/DEF/
${
RED_BOX_IMAGE_URL
}
`
,
);
expect
(
vm
.
$el
.
querySelector
(
'
.added img
'
).
getAttribute
(
'
src
'
)).
toBe
(
`//
-/
raw/ABC/
${
GREEN_BOX_IMAGE_URL
}
`
,
`//raw/ABC/
${
GREEN_BOX_IMAGE_URL
}
`
,
);
done
();
...
...
spec/lib/banzai/filter/relative_link_filter_spec.rb
View file @
7f833087
...
...
@@ -153,11 +153,11 @@ describe Banzai::Filter::RelativeLinkFilter do
it
'rebuilds absolute URL for a file in the repo'
do
doc
=
filter
(
link
(
'/doc/api/README.md'
))
expect
(
doc
.
at_css
(
'a'
)[
'href'
])
.
to
eq
"/
#{
project_path
}
/
-/
blob/
#{
ref
}
/doc/api/README.md"
.
to
eq
"/
#{
project_path
}
/blob/
#{
ref
}
/doc/api/README.md"
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
...
...
@@ -171,13 +171,13 @@ describe Banzai::Filter::RelativeLinkFilter do
it
'rebuilds relative URL for a file in the repo'
do
doc
=
filter
(
link
(
'doc/api/README.md'
))
expect
(
doc
.
at_css
(
'a'
)[
'href'
])
.
to
eq
"/
#{
project_path
}
/
-/
blob/
#{
ref
}
/doc/api/README.md"
.
to
eq
"/
#{
project_path
}
/blob/
#{
ref
}
/doc/api/README.md"
end
it
'rebuilds relative URL for a file in the repo with leading ./'
do
doc
=
filter
(
link
(
'./doc/api/README.md'
))
expect
(
doc
.
at_css
(
'a'
)[
'href'
])
.
to
eq
"/
#{
project_path
}
/
-/
blob/
#{
ref
}
/doc/api/README.md"
.
to
eq
"/
#{
project_path
}
/blob/
#{
ref
}
/doc/api/README.md"
end
it
'rebuilds relative URL for a file in the repo up one directory'
do
...
...
@@ -185,7 +185,7 @@ describe Banzai::Filter::RelativeLinkFilter do
doc
=
filter
(
relative_link
,
requested_path:
'doc/update/7.14-to-8.0.md'
)
expect
(
doc
.
at_css
(
'a'
)[
'href'
])
.
to
eq
"/
#{
project_path
}
/
-/
blob/
#{
ref
}
/doc/api/README.md"
.
to
eq
"/
#{
project_path
}
/blob/
#{
ref
}
/doc/api/README.md"
end
it
'rebuilds relative URL for a file in the repo up multiple directories'
do
...
...
@@ -193,7 +193,7 @@ describe Banzai::Filter::RelativeLinkFilter do
doc
=
filter
(
relative_link
,
requested_path:
'doc/foo/bar/baz/README.md'
)
expect
(
doc
.
at_css
(
'a'
)[
'href'
])
.
to
eq
"/
#{
project_path
}
/
-/
blob/
#{
ref
}
/doc/api/README.md"
.
to
eq
"/
#{
project_path
}
/blob/
#{
ref
}
/doc/api/README.md"
end
it
'rebuilds relative URL for a file in the repository root'
do
...
...
@@ -201,47 +201,47 @@ describe Banzai::Filter::RelativeLinkFilter do
doc
=
filter
(
relative_link
,
requested_path:
'doc/some-file.md'
)
expect
(
doc
.
at_css
(
'a'
)[
'href'
])
.
to
eq
"/
#{
project_path
}
/
-/
blob/
#{
ref
}
/README.md"
.
to
eq
"/
#{
project_path
}
/blob/
#{
ref
}
/README.md"
end
it
'rebuilds relative URL for a file in the repo with an anchor'
do
doc
=
filter
(
link
(
'README.md#section'
))
expect
(
doc
.
at_css
(
'a'
)[
'href'
])
.
to
eq
"/
#{
project_path
}
/
-/
blob/
#{
ref
}
/README.md#section"
.
to
eq
"/
#{
project_path
}
/blob/
#{
ref
}
/README.md#section"
end
it
'rebuilds relative URL for a directory in the repo'
do
doc
=
filter
(
link
(
'doc/api/'
))
expect
(
doc
.
at_css
(
'a'
)[
'href'
])
.
to
eq
"/
#{
project_path
}
/
-/
tree/
#{
ref
}
/doc/api"
.
to
eq
"/
#{
project_path
}
/tree/
#{
ref
}
/doc/api"
end
it
'rebuilds relative URL for an image in the repo'
do
doc
=
filter
(
image
(
'files/images/logo-black.png'
))
expect
(
doc
.
at_css
(
'img'
)[
'src'
])
.
to
eq
"/
#{
project_path
}
/
-/
raw/
#{
ref
}
/files/images/logo-black.png"
.
to
eq
"/
#{
project_path
}
/raw/
#{
ref
}
/files/images/logo-black.png"
end
it
'rebuilds relative URL for link to an image in the repo'
do
doc
=
filter
(
link
(
'files/images/logo-black.png'
))
expect
(
doc
.
at_css
(
'a'
)[
'href'
])
.
to
eq
"/
#{
project_path
}
/
-/
raw/
#{
ref
}
/files/images/logo-black.png"
.
to
eq
"/
#{
project_path
}
/raw/
#{
ref
}
/files/images/logo-black.png"
end
it
'rebuilds relative URL for a video in the repo'
do
doc
=
filter
(
video
(
'files/videos/intro.mp4'
),
commit:
project
.
commit
(
'video'
),
ref:
'video'
)
expect
(
doc
.
at_css
(
'video'
)[
'src'
])
.
to
eq
"/
#{
project_path
}
/
-/
raw/video/files/videos/intro.mp4"
.
to
eq
"/
#{
project_path
}
/raw/video/files/videos/intro.mp4"
end
it
'rebuilds relative URL for audio in the repo'
do
doc
=
filter
(
audio
(
'files/audio/sample.wav'
),
commit:
project
.
commit
(
'audio'
),
ref:
'audio'
)
expect
(
doc
.
at_css
(
'audio'
)[
'src'
])
.
to
eq
"/
#{
project_path
}
/
-/
raw/audio/files/audio/sample.wav"
.
to
eq
"/
#{
project_path
}
/raw/audio/files/audio/sample.wav"
end
it
'does not modify relative URL with an anchor only'
do
...
...
@@ -268,7 +268,7 @@ describe Banzai::Filter::RelativeLinkFilter do
allow_any_instance_of
(
described_class
).
to
receive
(
:uri_type
).
and_return
(
:raw
)
doc
=
filter
(
image
(
escaped
))
expect
(
doc
.
at_css
(
'img'
)[
'src'
]).
to
eq
"/
#{
project_path
}
/
-/
raw/
#{
Addressable
::
URI
.
escape
(
ref
)
}
/
#{
escaped
}
"
expect
(
doc
.
at_css
(
'img'
)[
'src'
]).
to
eq
"/
#{
project_path
}
/raw/
#{
Addressable
::
URI
.
escape
(
ref
)
}
/
#{
escaped
}
"
end
context
'when requested path is a file in the repo'
do
...
...
@@ -276,7 +276,7 @@ describe Banzai::Filter::RelativeLinkFilter do
it
'rebuilds URL relative to the containing directory'
do
doc
=
filter
(
link
(
'users.md'
))
expect
(
doc
.
at_css
(
'a'
)[
'href'
]).
to
eq
"/
#{
project_path
}
/
-/
blob/
#{
Addressable
::
URI
.
escape
(
ref
)
}
/doc/api/users.md"
expect
(
doc
.
at_css
(
'a'
)[
'href'
]).
to
eq
"/
#{
project_path
}
/blob/
#{
Addressable
::
URI
.
escape
(
ref
)
}
/doc/api/users.md"
end
end
...
...
@@ -285,7 +285,7 @@ describe Banzai::Filter::RelativeLinkFilter do
it
'rebuilds URL relative to the directory'
do
doc
=
filter
(
link
(
'users.md'
))
expect
(
doc
.
at_css
(
'a'
)[
'href'
]).
to
eq
"/
#{
project_path
}
/
-/
blob/
#{
Addressable
::
URI
.
escape
(
ref
)
}
/doc/api/users.md"
expect
(
doc
.
at_css
(
'a'
)[
'href'
]).
to
eq
"/
#{
project_path
}
/blob/
#{
Addressable
::
URI
.
escape
(
ref
)
}
/doc/api/users.md"
end
end
...
...
@@ -296,7 +296,7 @@ describe Banzai::Filter::RelativeLinkFilter do
it
'correctly escapes the ref'
do
doc
=
filter
(
link
(
'.gitkeep'
))
expect
(
doc
.
at_css
(
'a'
)[
'href'
]).
to
eq
"/
#{
project_path
}
/
-/
blob/
#{
Addressable
::
URI
.
escape
(
ref
)
}
/foo/bar/.gitkeep"
expect
(
doc
.
at_css
(
'a'
)[
'href'
]).
to
eq
"/
#{
project_path
}
/blob/
#{
Addressable
::
URI
.
escape
(
ref
)
}
/foo/bar/.gitkeep"
end
end
...
...
@@ -315,7 +315,7 @@ describe Banzai::Filter::RelativeLinkFilter do
doc
=
filter
(
link
(
path
))
expect
(
doc
.
at_css
(
'a'
)[
'href'
])
.
to
eq
"/
#{
project_path
}
/
-/
raw/
#{
ref_escaped
}
/files/images/logo-black.png"
.
to
eq
"/
#{
project_path
}
/raw/
#{
ref_escaped
}
/files/images/logo-black.png"
end
end
...
...
@@ -326,7 +326,7 @@ describe Banzai::Filter::RelativeLinkFilter do
it
'does not escape the space twice'
do
doc
=
filter
(
link
(
'README.md'
))
expect
(
doc
.
at_css
(
'a'
)[
'href'
]).
to
eq
"/
#{
project_path
}
/
-/
blob/
#{
Addressable
::
URI
.
escape
(
ref
)
}
/with%20space/README.md"
expect
(
doc
.
at_css
(
'a'
)[
'href'
]).
to
eq
"/
#{
project_path
}
/blob/
#{
Addressable
::
URI
.
escape
(
ref
)
}
/with%20space/README.md"
end
end
end
...
...
spec/lib/gitlab/conflict/file_spec.rb
View file @
7f833087
...
...
@@ -258,7 +258,7 @@ FILE
describe
'#as_json'
do
it
'includes the blob path for the file'
do
expect
(
conflict_file
.
as_json
[
:blob_path
])
.
to
eq
(
"/
#{
project
.
full_path
}
/
-/
blob/
#{
our_commit
.
oid
}
/files/ruby/regex.rb"
)
.
to
eq
(
"/
#{
project
.
full_path
}
/blob/
#{
our_commit
.
oid
}
/files/ruby/regex.rb"
)
end
it
'includes the blob icon for the file'
do
...
...
spec/lib/gitlab/data_builder/pipeline_spec.rb
View file @
7f833087
...
...
@@ -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/dependency_linker/godeps_json_linker_spec.rb
View file @
7f833087
...
...
@@ -75,8 +75,8 @@ describe Gitlab::DependencyLinker::GodepsJsonLinker do
end
it
'links GitLab projects'
do
expect
(
subject
).
to
include
(
link
(
'gitlab.com/group/project/path'
,
'https://gitlab.com/group/project/
-/
tree/master/path'
))
expect
(
subject
).
to
include
(
link
(
'gitlab.com/group/subgroup/project.git/path'
,
'https://gitlab.com/group/subgroup/project/
-/
tree/master/path'
))
expect
(
subject
).
to
include
(
link
(
'gitlab.com/group/project/path'
,
'https://gitlab.com/group/project/tree/master/path'
))
expect
(
subject
).
to
include
(
link
(
'gitlab.com/group/subgroup/project.git/path'
,
'https://gitlab.com/group/subgroup/project/tree/master/path'
))
end
it
'links Golang packages'
do
...
...
spec/lib/gitlab/middleware/go_spec.rb
View file @
7f833087
...
...
@@ -241,7 +241,7 @@ describe Gitlab::Middleware::Go do
project_url
=
"http://
#{
Gitlab
.
config
.
gitlab
.
host
}
/
#{
path
}
"
expect
(
response
[
0
]).
to
eq
(
200
)
expect
(
response
[
1
][
'Content-Type'
]).
to
eq
(
'text/html'
)
expected_body
=
%{<html><head><meta name="go-import" content="#{Gitlab.config.gitlab.host}/#{path} git #{repository_url}" /><meta name="go-source" content="#{Gitlab.config.gitlab.host}/#{path} #{project_url} #{project_url}/
-/tree/#{branch}{/dir} #{project_url}/-
/blob/#{branch}{/dir}/{file}#L{line}" /></head><body>go get #{Gitlab.config.gitlab.url}/#{path}</body></html>}
expected_body
=
%{<html><head><meta name="go-import" content="#{Gitlab.config.gitlab.host}/#{path} git #{repository_url}" /><meta name="go-source" content="#{Gitlab.config.gitlab.host}/#{path} #{project_url} #{project_url}/
tree/#{branch}{/dir} #{project_url}
/blob/#{branch}{/dir}/{file}#L{line}" /></head><body>go get #{Gitlab.config.gitlab.url}/#{path}</body></html>}
expect
(
response
[
2
].
body
).
to
eq
([
expected_body
])
end
end
...
...
spec/lib/gitlab/url_builder_spec.rb
View file @
7f833087
...
...
@@ -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 @
7f833087
...
...
@@ -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/models/project_spec.rb
View file @
7f833087
...
...
@@ -697,7 +697,7 @@ describe Project do
let
(
:project
)
{
create
(
:project
,
:repository
)
}
it
'returns the README'
do
expect
(
project
.
readme_url
).
to
eq
(
"
#{
project
.
web_url
}
/
-/
blob/master/README.md"
)
expect
(
project
.
readme_url
).
to
eq
(
"
#{
project
.
web_url
}
/blob/master/README.md"
)
end
end
end
...
...
spec/presenters/blob_presenter_spec.rb
View file @
7f833087
...
...
@@ -21,7 +21,7 @@ describe BlobPresenter, :seed_helper do
subject
{
described_class
.
new
(
blob
)
}
it
{
expect
(
subject
.
web_url
).
to
eq
(
"http://localhost/
#{
project
.
full_path
}
/
-/
blob/
#{
blob
.
commit_id
}
/
#{
blob
.
path
}
"
)
}
it
{
expect
(
subject
.
web_url
).
to
eq
(
"http://localhost/
#{
project
.
full_path
}
/blob/
#{
blob
.
commit_id
}
/
#{
blob
.
path
}
"
)
}
end
describe
'#highlight'
do
...
...
spec/presenters/merge_request_presenter_spec.rb
View file @
7f833087
...
...
@@ -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
...
...
@@ -334,7 +334,7 @@ describe MergeRequestPresenter do
allow
(
resource
).
to
receive
(
:target_branch_exists?
)
{
true
}
is_expected
.
to
eq
(
"/
#{
resource
.
target_project
.
full_path
}
/
-/
commits/
#{
resource
.
target_branch
}
"
)
.
to
eq
(
"/
#{
resource
.
target_project
.
full_path
}
/commits/
#{
resource
.
target_branch
}
"
)
end
end
...
...
@@ -358,7 +358,7 @@ describe MergeRequestPresenter do
allow
(
resource
).
to
receive
(
:source_branch_exists?
)
{
true
}
is_expected
.
to
eq
(
"/
#{
resource
.
source_project
.
full_path
}
/
-/
commits/
#{
resource
.
source_branch
}
"
)
.
to
eq
(
"/
#{
resource
.
source_project
.
full_path
}
/commits/
#{
resource
.
source_branch
}
"
)
end
end
...
...
@@ -382,7 +382,7 @@ describe MergeRequestPresenter do
allow
(
resource
).
to
receive
(
:target_branch_exists?
)
{
true
}
is_expected
.
to
eq
(
"/
#{
resource
.
target_project
.
full_path
}
/
-/
tree/
#{
resource
.
target_branch
}
"
)
.
to
eq
(
"/
#{
resource
.
target_project
.
full_path
}
/tree/
#{
resource
.
target_branch
}
"
)
end
end
...
...
@@ -496,7 +496,7 @@ describe MergeRequestPresenter do
allow
(
resource
).
to
receive
(
:source_branch_exists?
)
{
true
}
is_expected
.
to
eq
(
"<a href=
\"
/
#{
resource
.
source_project
.
full_path
}
/
-/
tree/
#{
resource
.
source_branch
}
\"
>
#{
resource
.
source_branch
}
</a>"
)
.
to
eq
(
"<a href=
\"
/
#{
resource
.
source_project
.
full_path
}
/tree/
#{
resource
.
source_branch
}
\"
>
#{
resource
.
source_branch
}
</a>"
)
end
it
'escapes html, when source_branch does not exist'
do
...
...
@@ -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/presenters/tree_entry_presenter_spec.rb
View file @
7f833087
...
...
@@ -11,6 +11,6 @@ describe TreeEntryPresenter do
let
(
:presenter
)
{
described_class
.
new
(
tree
)
}
describe
'.web_url'
do
it
{
expect
(
presenter
.
web_url
).
to
eq
(
"http://localhost/
#{
project
.
full_path
}
/
-/
tree/
#{
tree
.
commit_id
}
/
#{
tree
.
path
}
"
)
}
it
{
expect
(
presenter
.
web_url
).
to
eq
(
"http://localhost/
#{
project
.
full_path
}
/tree/
#{
tree
.
commit_id
}
/
#{
tree
.
path
}
"
)
}
end
end
spec/requests/api/internal/base_spec.rb
View file @
7f833087
...
...
@@ -852,7 +852,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
))
...
...
@@ -909,7 +909,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/projects_spec.rb
View file @
7f833087
...
...
@@ -715,7 +715,7 @@ describe API::Projects do
post
api
(
'/projects'
,
user
),
params:
project
expect
(
json_response
[
'readme_url'
]).
to
eql
(
"
#{
Gitlab
.
config
.
gitlab
.
url
}
/
#{
json_response
[
'namespace'
][
'full_path'
]
}
/somewhere/
-/
blob/master/README.md"
)
expect
(
json_response
[
'readme_url'
]).
to
eql
(
"
#{
Gitlab
.
config
.
gitlab
.
url
}
/
#{
json_response
[
'namespace'
][
'full_path'
]
}
/somewhere/blob/master/README.md"
)
end
it
'sets tag list to a project'
do
...
...
spec/requests/api/releases_spec.rb
View file @
7f833087
...
...
@@ -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/git_http_spec.rb
View file @
7f833087
...
...
@@ -834,7 +834,7 @@ describe 'Git HTTP requests' do
Blob
.
decorate
(
Gitlab
::
Git
::
Blob
.
find
(
project
.
repository
,
'master'
,
'bar/branch-test.txt'
),
project
)
end
get
"/
#{
project
.
full_path
}
/
-/
blob/master/info/refs"
get
"/
#{
project
.
full_path
}
/blob/master/info/refs"
end
it
"returns the file"
do
...
...
@@ -844,7 +844,7 @@ describe 'Git HTTP requests' do
context
"when the file does not exist"
do
before
do
get
"/
#{
project
.
full_path
}
/
-/
blob/master/info/refs"
get
"/
#{
project
.
full_path
}
/blob/master/info/refs"
end
it
"redirects"
do
...
...
spec/requests/projects/merge_requests_discussions_spec.rb
View file @
7f833087
...
...
@@ -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 @
7f833087
...
...
@@ -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 @
7f833087
This diff is collapsed.
Click to expand it.
spec/serializers/blob_entity_spec.rb
View file @
7f833087
...
...
@@ -23,7 +23,7 @@ describe BlobEntity do
mode:
"100644"
,
readable_text:
true
,
icon:
"file-text-o"
,
url:
"/
#{
project
.
full_path
}
/
-/
blob/master/bar/branch-test.txt"
url:
"/
#{
project
.
full_path
}
/blob/master/bar/branch-test.txt"
})
end
end
...
...
spec/serializers/merge_request_poll_widget_entity_spec.rb
View file @
7f833087
...
...
@@ -60,7 +60,7 @@ describe MergeRequestPollWidgetEntity do
project
.
add_developer
(
user
)
expect
(
subject
[
:new_blob_path
])
.
to
eq
(
"/
#{
resource
.
project
.
full_path
}
/
-/
new/
#{
resource
.
source_branch
}
"
)
.
to
eq
(
"/
#{
resource
.
project
.
full_path
}
/new/
#{
resource
.
source_branch
}
"
)
end
end
...
...
spec/serializers/merge_request_widget_entity_spec.rb
View file @
7f833087
...
...
@@ -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 @
7f833087
...
...
@@ -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 @
7f833087
...
...
@@ -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 @
7f833087
...
...
@@ -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
}
"
}
...
...
@@ -127,7 +127,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 @
7f833087
...
...
@@ -328,7 +328,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
})
...
...
spec/views/help/index.html.haml_spec.rb
View file @
7f833087
...
...
@@ -40,7 +40,7 @@ describe 'help/index' do
render
expect
(
rendered
).
to
match
'8.0.2'
expect
(
rendered
).
to
have_link
(
'abcdefg'
,
href:
%r{https://gitlab.com/gitlab-org/(gitlab|gitlab-foss)/
-/
commits/abcdefg}
)
expect
(
rendered
).
to
have_link
(
'abcdefg'
,
href:
%r{https://gitlab.com/gitlab-org/(gitlab|gitlab-foss)/commits/abcdefg}
)
end
end
end
...
...
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