Skip to content
Snippets Groups Projects
Verified Commit c5c906fe authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files
parent 7f4b9937
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -8,7 +8,7 @@ module Gitlab
@query = Shellwords.shellescape(query) if query.present?
end
 
def objects(scope, page)
def objects(scope, page = nil)
case scope
when 'notes'
notes.page(page).per(per_page)
Loading
Loading
Loading
Loading
@@ -11,7 +11,7 @@ module Gitlab
@query = Shellwords.shellescape(query) if query.present?
end
 
def objects(scope, page)
def objects(scope, page = nil)
case scope
when 'projects'
projects.page(page).per(per_page)
Loading
Loading
Loading
Loading
@@ -19,7 +19,7 @@ describe 'Search::GlobalService' do
it 'should return public projects only' do
context = Search::GlobalService.new(nil, search: "searchable")
results = context.execute
results[:projects].should match_array [public_project]
results.objects('projects').should match_array [public_project]
end
end
 
Loading
Loading
@@ -27,19 +27,19 @@ describe 'Search::GlobalService' do
it 'should return public, internal and private projects' do
context = Search::GlobalService.new(user, search: "searchable")
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
 
it 'should return only public & internal projects' do
context = Search::GlobalService.new(internal_user, search: "searchable")
results = context.execute
results[:projects].should match_array [internal_project, public_project]
results.objects('projects').should match_array [internal_project, public_project]
end
 
it 'namespace name should be searchable' do
context = Search::GlobalService.new(user, search: found_project.namespace.path)
results = context.execute
results[:projects].should match_array [found_project]
results.objects('projects').should match_array [found_project]
end
end
end
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment