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
a3a919b7
Commit
a3a919b7
authored
Apr 29, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
5af8fde9
cfe04803
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
12 deletions
+31
-12
app/views/search/results/_wiki_blob.html.haml
app/views/search/results/_wiki_blob.html.haml
+1
-1
changelogs/unreleased/wiki-search-results-fix.yml
changelogs/unreleased/wiki-search-results-fix.yml
+5
-0
spec/features/search/user_searches_for_wiki_pages_spec.rb
spec/features/search/user_searches_for_wiki_pages_spec.rb
+25
-11
No files found.
app/views/search/results/_wiki_blob.html.haml
View file @
a3a919b7
-
project
=
find_project_for_result_blob
(
projects
,
wiki_blob
)
-
wiki_blob
=
parse_search_result
(
wiki_blob
)
-
wiki_blob_link
=
project_wiki_path
(
project
,
wiki_blob
.
basename
)
-
wiki_blob_link
=
project_wiki_path
(
project
,
Pathname
.
new
(
wiki_blob
.
filename
).
sub_ext
(
''
)
)
=
render
partial:
'search/results/blob_data'
,
locals:
{
blob:
wiki_blob
,
project:
project
,
file_name:
wiki_blob
.
filename
,
blob_link:
wiki_blob_link
}
changelogs/unreleased/wiki-search-results-fix.yml
0 → 100644
View file @
a3a919b7
---
title
:
fix wiki search result links in titles
merge_request
:
27400
author
:
khm
type
:
fixed
spec/features/search/user_searches_for_wiki_pages_spec.rb
View file @
a3a919b7
...
...
@@ -14,22 +14,36 @@ describe 'User searches for wiki pages', :js do
include_examples
'top right search form'
it
'finds a page'
do
find
(
'.js-search-project-dropdown'
).
click
shared_examples
'search wiki blobs'
do
it
'finds a page'
do
find
(
'.js-search-project-dropdown'
).
click
page
.
within
(
'.project-filter'
)
do
click_link
(
project
.
full_name
)
end
page
.
within
(
'.project-filter'
)
do
click_link
(
project
.
full_name
)
end
fill_in
(
'dashboard_search'
,
with:
'content'
)
find
(
'.btn-search'
).
click
page
.
within
(
'.search-filter'
)
do
click_link
(
'Wiki'
)
end
fill_in
(
'dashboard_search'
,
with:
'content'
)
find
(
'.btn-search'
).
click
page
.
within
(
'.results'
)
do
expect
(
find
(
:css
,
'.search-results'
)).
to
have_link
(
wiki_page
.
title
,
href:
project_wiki_path
(
project
,
wiki_page
.
slug
))
end
end
end
page
.
within
(
'.search-filter'
)
do
click_link
(
'Wiki'
)
context
'when searching by content'
do
it_behaves_like
'search wiki blobs'
do
let
(
:search_term
)
{
'content'
}
end
end
page
.
within
(
'.results'
)
do
expect
(
find
(
:css
,
'.search-results'
)).
to
have_link
(
wiki_page
.
title
)
context
'when searching by title'
do
it_behaves_like
'search wiki blobs'
do
let
(
:search_term
)
{
'test_wiki'
}
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