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
93977c68
Commit
93977c68
authored
Apr 25, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
7207c543
f04f6909
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
3 deletions
+31
-3
app/views/search/_results.html.haml
app/views/search/_results.html.haml
+2
-3
changelogs/unreleased/60906-fix-wiki-links.yml
changelogs/unreleased/60906-fix-wiki-links.yml
+5
-0
spec/controllers/search_controller_spec.rb
spec/controllers/search_controller_spec.rb
+24
-0
No files found.
app/views/search/_results.html.haml
View file @
93977c68
...
...
@@ -22,10 +22,9 @@
-
if
@scope
==
'projects'
.term
=
render
'shared/projects/list'
,
projects:
@search_objects
,
pipeline_status:
false
-
elsif
%w[blobs wiki_blobs]
.
include?
(
@scope
)
=
render
partial:
'search/results/blob'
,
collection:
@search_objects
,
locals:
{
projects:
blob_projects
(
@search_objects
)
}
-
else
=
render
partial:
"search/results/
#{
@scope
.
singularize
}
"
,
collection:
@search_objects
-
locals
=
{
projects:
blob_projects
(
@search_objects
)
}
if
%w[blobs wiki_blobs]
.
include?
(
@scope
)
=
render
partial:
"search/results/
#{
@scope
.
singularize
}
"
,
collection:
@search_objects
,
locals:
locals
-
if
@scope
!=
'projects'
=
paginate_collection
(
@search_objects
)
changelogs/unreleased/60906-fix-wiki-links.yml
0 → 100644
View file @
93977c68
---
title
:
Show proper wiki links in search results
merge_request
:
27634
author
:
type
:
fixed
spec/controllers/search_controller_spec.rb
View file @
93977c68
...
...
@@ -11,6 +11,30 @@ describe SearchController do
sign_in
(
user
)
end
context
'uses the right partials depending on scope'
do
using
RSpec
::
Parameterized
::
TableSyntax
render_views
set
(
:project
)
{
create
(
:project
,
:public
,
:repository
,
:wiki_repo
)
}
subject
{
get
(
:show
,
params:
{
project_id:
project
.
id
,
scope:
scope
,
search:
'merge'
})
}
where
(
:partial
,
:scope
)
do
'_blob'
|
:blobs
'_wiki_blob'
|
:wiki_blobs
'_commit'
|
:commits
end
with_them
do
it
do
project_wiki
=
create
(
:project_wiki
,
project:
project
,
user:
user
)
create
(
:wiki_page
,
wiki:
project_wiki
,
attrs:
{
title:
'merge'
,
content:
'merge'
})
expect
(
subject
).
to
render_template
(
"search/results/
#{
partial
}
"
)
end
end
end
it
'finds issue comments'
do
project
=
create
(
:project
,
:public
)
note
=
create
(
:note_on_issue
,
project:
project
)
...
...
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