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
dbaeb025
Commit
dbaeb025
authored
Nov 09, 2016
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolve global_search_spec.rb
parent
937fe659
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
76 additions
and
48 deletions
+76
-48
spec/features/es_global_search_spec.rb
spec/features/es_global_search_spec.rb
+74
-0
spec/features/global_search_spec.rb
spec/features/global_search_spec.rb
+2
-48
No files found.
spec/features/es_global_search_spec.rb
0 → 100644
View file @
dbaeb025
require
'spec_helper'
feature
'Global elastic search'
,
feature:
true
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
,
namespace:
user
.
namespace
)
}
before
do
stub_application_setting
(
elasticsearch_search:
true
,
elasticsearch_indexing:
true
)
Gitlab
::
Elastic
::
Helper
.
create_empty_index
project
.
team
<<
[
user
,
:master
]
login_with
(
user
)
end
after
do
Gitlab
::
Elastic
::
Helper
.
delete_index
stub_application_setting
(
elasticsearch_search:
false
,
elasticsearch_indexing:
false
)
end
describe
'I search through the issues and I see pagination'
do
before
do
create_list
(
:issue
,
21
,
project:
project
,
title:
'initial'
)
Gitlab
::
Elastic
::
Helper
.
refresh_index
end
it
"has a pagination"
do
visit
dashboard_projects_path
fill_in
"search"
,
with:
"initial"
click_button
"Go"
select_filter
(
"Issues"
)
expect
(
page
).
to
have_selector
(
'.gl-pagination .page'
,
count:
2
)
end
end
describe
'I search through the blobs'
do
before
do
project
.
repository
.
index_blobs
Gitlab
::
Elastic
::
Helper
.
refresh_index
end
it
"finds files"
do
visit
dashboard_projects_path
fill_in
"search"
,
with:
"def"
click_button
"Go"
select_filter
(
"Code"
)
expect
(
page
).
to
have_selector
(
'.file-content .code'
)
end
end
describe
'I search through the commits'
do
before
do
project
.
repository
.
index_commits
Gitlab
::
Elastic
::
Helper
.
refresh_index
end
it
"finds commits"
do
visit
dashboard_projects_path
fill_in
"search"
,
with:
"add"
click_button
"Go"
select_filter
(
"Commits"
)
expect
(
page
).
to
have_selector
(
'.commit-row-description'
)
end
end
end
spec/features/global_search_spec.rb
View file @
dbaeb025
...
...
@@ -5,23 +5,14 @@ feature 'Global search', feature: true do
let
(
:project
)
{
create
(
:project
,
namespace:
user
.
namespace
)
}
before
do
stub_application_setting
(
elasticsearch_search:
true
,
elasticsearch_indexing:
true
)
Gitlab
::
Elastic
::
Helper
.
create_empty_index
project
.
team
<<
[
user
,
:master
]
login_with
(
user
)
end
after
do
Gitlab
::
Elastic
::
Helper
.
delete_index
stub_application_setting
(
elasticsearch_search:
false
,
elasticsearch_indexing:
false
)
end
describe
'I search through the issues and I see pagination'
do
before
do
create_list
(
:issue
,
21
,
project:
project
,
title:
'initial'
)
Gitlab
::
Elastic
::
Helper
.
refresh_index
allow_any_instance_of
(
Gitlab
::
SearchResults
).
to
receive
(
:per_page
).
and_return
(
1
)
create_list
(
:issue
,
2
,
project:
project
,
title:
'initial'
)
end
it
"has a pagination"
do
...
...
@@ -34,41 +25,4 @@ feature 'Global search', feature: true do
expect
(
page
).
to
have_selector
(
'.gl-pagination .page'
,
count:
2
)
end
end
describe
'I search through the blobs'
do
before
do
project
.
repository
.
index_blobs
Gitlab
::
Elastic
::
Helper
.
refresh_index
end
it
"finds files"
do
visit
dashboard_projects_path
fill_in
"search"
,
with:
"def"
click_button
"Go"
select_filter
(
"Code"
)
expect
(
page
).
to
have_selector
(
'.file-content .code'
)
end
end
describe
'I search through the commits'
do
before
do
project
.
repository
.
index_commits
Gitlab
::
Elastic
::
Helper
.
refresh_index
end
it
"finds commits"
do
visit
dashboard_projects_path
fill_in
"search"
,
with:
"add"
click_button
"Go"
select_filter
(
"Commits"
)
expect
(
page
).
to
have_selector
(
'.commit-row-description'
)
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