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
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
c5c906fe
Commit
c5c906fe
authored
Aug 27, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix tests
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
7f4b9937
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
lib/gitlab/project_search_results.rb
lib/gitlab/project_search_results.rb
+1
-1
lib/gitlab/search_results.rb
lib/gitlab/search_results.rb
+1
-1
spec/services/search_service_spec.rb
spec/services/search_service_spec.rb
+4
-4
No files found.
lib/gitlab/project_search_results.rb
View file @
c5c906fe
...
@@ -8,7 +8,7 @@ module Gitlab
...
@@ -8,7 +8,7 @@ module Gitlab
@query
=
Shellwords
.
shellescape
(
query
)
if
query
.
present?
@query
=
Shellwords
.
shellescape
(
query
)
if
query
.
present?
end
end
def
objects
(
scope
,
page
)
def
objects
(
scope
,
page
=
nil
)
case
scope
case
scope
when
'notes'
when
'notes'
notes
.
page
(
page
).
per
(
per_page
)
notes
.
page
(
page
).
per
(
per_page
)
...
...
lib/gitlab/search_results.rb
View file @
c5c906fe
...
@@ -11,7 +11,7 @@ module Gitlab
...
@@ -11,7 +11,7 @@ module Gitlab
@query
=
Shellwords
.
shellescape
(
query
)
if
query
.
present?
@query
=
Shellwords
.
shellescape
(
query
)
if
query
.
present?
end
end
def
objects
(
scope
,
page
)
def
objects
(
scope
,
page
=
nil
)
case
scope
case
scope
when
'projects'
when
'projects'
projects
.
page
(
page
).
per
(
per_page
)
projects
.
page
(
page
).
per
(
per_page
)
...
...
spec/services/search_service_spec.rb
View file @
c5c906fe
...
@@ -19,7 +19,7 @@ describe 'Search::GlobalService' do
...
@@ -19,7 +19,7 @@ describe 'Search::GlobalService' do
it
'should return public projects only'
do
it
'should return public projects only'
do
context
=
Search
::
GlobalService
.
new
(
nil
,
search:
"searchable"
)
context
=
Search
::
GlobalService
.
new
(
nil
,
search:
"searchable"
)
results
=
context
.
execute
results
=
context
.
execute
results
[
:projects
]
.
should
match_array
[
public_project
]
results
.
objects
(
'projects'
)
.
should
match_array
[
public_project
]
end
end
end
end
...
@@ -27,19 +27,19 @@ describe 'Search::GlobalService' do
...
@@ -27,19 +27,19 @@ describe 'Search::GlobalService' do
it
'should return public, internal and private projects'
do
it
'should return public, internal and private projects'
do
context
=
Search
::
GlobalService
.
new
(
user
,
search:
"searchable"
)
context
=
Search
::
GlobalService
.
new
(
user
,
search:
"searchable"
)
results
=
context
.
execute
results
=
context
.
execute
results
[
:projects
]
.
should
match_array
[
public_project
,
found_project
,
internal_project
]
results
.
objects
(
'projects'
)
.
should
match_array
[
public_project
,
found_project
,
internal_project
]
end
end
it
'should return only public & internal projects'
do
it
'should return only public & internal projects'
do
context
=
Search
::
GlobalService
.
new
(
internal_user
,
search:
"searchable"
)
context
=
Search
::
GlobalService
.
new
(
internal_user
,
search:
"searchable"
)
results
=
context
.
execute
results
=
context
.
execute
results
[
:projects
]
.
should
match_array
[
internal_project
,
public_project
]
results
.
objects
(
'projects'
)
.
should
match_array
[
internal_project
,
public_project
]
end
end
it
'namespace name should be searchable'
do
it
'namespace name should be searchable'
do
context
=
Search
::
GlobalService
.
new
(
user
,
search:
found_project
.
namespace
.
path
)
context
=
Search
::
GlobalService
.
new
(
user
,
search:
found_project
.
namespace
.
path
)
results
=
context
.
execute
results
=
context
.
execute
results
[
:projects
]
.
should
match_array
[
found_project
]
results
.
objects
(
'projects'
)
.
should
match_array
[
found_project
]
end
end
end
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