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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kazuhiko Shiozaki
gitlab-ce
Commits
9ef5898e
Commit
9ef5898e
authored
Jun 18, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix search tests
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
85333f09
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
12 deletions
+11
-12
spec/services/search_service_spec.rb
spec/services/search_service_spec.rb
+11
-12
No files found.
spec/services/search_service_spec.rb
View file @
9ef5898e
require
'spec_helper'
require
'spec_helper'
describe
'Search::GlobalService'
do
describe
'Search::GlobalService'
do
let
(
:user
)
{
create
(
:user
,
namespace:
found_namespace
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:public_user
)
{
create
(
:user
,
namespace:
public_namespace
)
}
let
(
:public_user
)
{
create
(
:user
)
}
let
(
:internal_user
)
{
create
(
:user
,
namespace:
internal_namespace
)
}
let
(
:internal_user
)
{
create
(
:user
)
}
let
(
:found_namespace
)
{
create
(
:namespace
,
name:
'searchable namespace'
,
path
:'another_thing
'
)
}
let
!
(
:found_project
)
{
create
(
:empty_project
,
:private
,
name:
'searchable_project
'
)
}
let
(
:unfound_namespace
)
{
create
(
:namespace
,
name:
'unfound namespace'
,
path:
'yet_something_else
'
)
}
let
!
(
:unfound_project
)
{
create
(
:empty_project
,
:private
,
name:
'unfound_project
'
)
}
let
(
:internal_namespace
)
{
create
(
:namespace
,
name:
'searchable internal namespace'
,
path:
'something_internal
'
)
}
let
!
(
:internal_project
)
{
create
(
:empty_project
,
:internal
,
name:
'searchable_internal_project
'
)
}
let
(
:public_namespace
)
{
create
(
:namespace
,
name:
'searchable public namespace'
,
path:
'something_public
'
)
}
let
!
(
:public_project
)
{
create
(
:empty_project
,
:public
,
name:
'searchable_public_project
'
)
}
let!
(
:found_project
)
{
create
(
:project
,
:private
,
name:
'searchable_project'
,
creator_id:
user
.
id
,
namespace:
found_namespace
)
}
before
do
let!
(
:unfound_project
)
{
create
(
:project
,
:private
,
name:
'unfound_project'
,
creator_id:
user
.
id
,
namespace:
unfound_namespace
)
}
found_project
.
team
<<
[
user
,
:master
]
let!
(
:internal_project
)
{
create
(
:project
,
:internal
,
name:
'searchable_internal_project'
,
creator_id:
internal_user
.
id
,
namespace:
internal_namespace
)
}
end
let!
(
:public_project
)
{
create
(
:project
,
:public
,
name:
'searchable_public_project'
,
creator_id:
public_user
.
id
,
namespace:
public_namespace
)
}
describe
'#execute'
do
describe
'#execute'
do
context
'unauthenticated'
do
context
'unauthenticated'
do
...
@@ -38,7 +37,7 @@ describe 'Search::GlobalService' do
...
@@ -38,7 +37,7 @@ describe 'Search::GlobalService' do
end
end
it
'namespace name should be searchable'
do
it
'namespace name should be searchable'
do
context
=
Search
::
GlobalService
.
new
(
user
,
search:
"searchable namespace"
)
context
=
Search
::
GlobalService
.
new
(
user
,
search:
found_project
.
namespace
.
path
)
results
=
context
.
execute
results
=
context
.
execute
results
[
:projects
].
should
match_array
[
found_project
]
results
[
:projects
].
should
match_array
[
found_project
]
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