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
1a424a9b
Commit
1a424a9b
authored
May 23, 2017
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Explicitly test that guest is able to search through the wiki
parent
7487d06c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
4 deletions
+10
-4
app/helpers/search_helper.rb
app/helpers/search_helper.rb
+6
-0
app/views/search/_category.html.haml
app/views/search/_category.html.haml
+1
-1
spec/lib/gitlab/project_search_results_spec.rb
spec/lib/gitlab/project_search_results_spec.rb
+2
-2
spec/services/search_service_spec.rb
spec/services/search_service_spec.rb
+1
-1
No files found.
app/helpers/search_helper.rb
View file @
1a424a9b
...
@@ -33,6 +33,12 @@ module SearchHelper
...
@@ -33,6 +33,12 @@ module SearchHelper
def
parse_search_result
(
result
)
def
parse_search_result
(
result
)
Gitlab
::
ProjectSearchResults
.
parse_search_result
(
result
)
Gitlab
::
ProjectSearchResults
.
parse_search_result
(
result
)
end
end
def
show_notes_tab?
[
:read_merge_request
,
:download_code
,
:read_issue
,
:read_project_snippet
].
all?
do
|
ability
|
can?
(
current_user
,
:read_merge_request
,
@project
)
end
end
private
private
...
...
app/views/search/_category.html.haml
View file @
1a424a9b
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
Milestones
Milestones
%span
.badge
%span
.badge
=
@search_results
.
milestones_count
=
@search_results
.
milestones_count
-
if
can?
(
current_user
,
:read_merge_request
,
@project
)
||
can?
(
current_user
,
:read_issue
,
@project
)
-
if
show_notes_tab?
%li
{
class:
active_when
(
@scope
==
'notes'
)
}
%li
{
class:
active_when
(
@scope
==
'notes'
)
}
=
link_to
search_filter_path
(
scope:
'notes'
)
do
=
link_to
search_filter_path
(
scope:
'notes'
)
do
Comments
Comments
...
...
spec/lib/gitlab/project_search_results_spec.rb
View file @
1a424a9b
...
@@ -123,8 +123,8 @@ describe Gitlab::ProjectSearchResults, lib: true do
...
@@ -123,8 +123,8 @@ describe Gitlab::ProjectSearchResults, lib: true do
context
'when wiki is internal'
do
context
'when wiki is internal'
do
let
(
:project
)
{
create
(
:project
,
:public
,
:wiki_private
)
}
let
(
:project
)
{
create
(
:project
,
:public
,
:wiki_private
)
}
it
'finds wiki blobs for
members
'
do
it
'finds wiki blobs for
guest
'
do
project
.
add_
reporter
(
user
)
project
.
add_
guest
(
user
)
is_expected
.
not_to
be_empty
is_expected
.
not_to
be_empty
end
end
...
...
spec/services/search_service_spec.rb
View file @
1a424a9b
...
@@ -29,7 +29,7 @@ describe SearchService, services: true do
...
@@ -29,7 +29,7 @@ describe SearchService, services: true do
it
'returns the project for guests'
do
it
'returns the project for guests'
do
search_project
=
create
:empty_project
search_project
=
create
:empty_project
search_project
.
team
<<
[
user
,
:guest
]
search_project
.
add_guest
(
user
)
project
=
SearchService
.
new
(
user
,
project_id:
search_project
.
id
).
project
project
=
SearchService
.
new
(
user
,
project_id:
search_project
.
id
).
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