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
Boxiang Sun
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
Show 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'
describe
'Search::GlobalService'
do
let
(
:user
)
{
create
(
:user
,
namespace:
found_namespace
)
}
let
(
:public_user
)
{
create
(
:user
,
namespace:
public_namespace
)
}
let
(
:internal_user
)
{
create
(
:user
,
namespace:
internal_namespace
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:public_user
)
{
create
(
:user
)
}
let
(
:internal_user
)
{
create
(
:user
)
}
let
(
:found_namespace
)
{
create
(
:namespace
,
name:
'searchable namespace'
,
path
:'another_thing
'
)
}
let
(
:unfound_namespace
)
{
create
(
:namespace
,
name:
'unfound namespace'
,
path:
'yet_something_else
'
)
}
let
(
:internal_namespace
)
{
create
(
:namespace
,
name:
'searchable internal namespace'
,
path:
'something_internal
'
)
}
let
(
:public_namespace
)
{
create
(
:namespace
,
name:
'searchable public namespace'
,
path:
'something_public
'
)
}
let
!
(
:found_project
)
{
create
(
:empty_project
,
:private
,
name:
'searchable_project
'
)
}
let
!
(
:unfound_project
)
{
create
(
:empty_project
,
:private
,
name:
'unfound_project
'
)
}
let
!
(
:internal_project
)
{
create
(
:empty_project
,
:internal
,
name:
'searchable_internal_project
'
)
}
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
)
}
let!
(
:unfound_project
)
{
create
(
:project
,
:private
,
name:
'unfound_project'
,
creator_id:
user
.
id
,
namespace:
unfound_namespace
)
}
let!
(
:internal_project
)
{
create
(
:project
,
:internal
,
name:
'searchable_internal_project'
,
creator_id:
internal_user
.
id
,
namespace:
internal_namespace
)
}
let!
(
:public_project
)
{
create
(
:project
,
:public
,
name:
'searchable_public_project'
,
creator_id:
public_user
.
id
,
namespace:
public_namespace
)
}
before
do
found_project
.
team
<<
[
user
,
:master
]
end
describe
'#execute'
do
context
'unauthenticated'
do
...
...
@@ -38,7 +37,7 @@ describe 'Search::GlobalService' do
end
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
[
:projects
].
should
match_array
[
found_project
]
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