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
cacf128d
Commit
cacf128d
authored
Aug 19, 2019
by
minghuan lei
Committed by
Paul Slaughter
Aug 19, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add feature spec for search with space
parent
4fdc34c1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
5 deletions
+25
-5
spec/features/search/user_searches_for_code_spec.rb
spec/features/search/user_searches_for_code_spec.rb
+25
-5
No files found.
spec/features/search/user_searches_for_code_spec.rb
View file @
cacf128d
...
@@ -39,17 +39,16 @@ describe 'User searches for code' do
...
@@ -39,17 +39,16 @@ describe 'User searches for code' do
context
'when on a project page'
,
:js
do
context
'when on a project page'
,
:js
do
before
do
before
do
visit
(
search_path
)
visit
(
search_path
)
end
include_examples
'top right search form'
it
'finds code'
do
find
(
'.js-search-project-dropdown'
).
click
find
(
'.js-search-project-dropdown'
).
click
page
.
within
(
'.project-filter'
)
do
page
.
within
(
'.project-filter'
)
do
click_link
(
project
.
full_name
)
click_link
(
project
.
full_name
)
end
end
end
include_examples
'top right search form'
it
'finds code'
do
fill_in
(
'dashboard_search'
,
with:
'rspec'
)
fill_in
(
'dashboard_search'
,
with:
'rspec'
)
find
(
'.btn-search'
).
click
find
(
'.btn-search'
).
click
...
@@ -57,6 +56,27 @@ describe 'User searches for code' do
...
@@ -57,6 +56,27 @@ describe 'User searches for code' do
expect
(
find
(
:css
,
'.search-results'
)).
to
have_content
(
'Update capybara, rspec-rails, poltergeist to recent versions'
)
expect
(
find
(
:css
,
'.search-results'
)).
to
have_content
(
'Update capybara, rspec-rails, poltergeist to recent versions'
)
end
end
end
end
it
'search mutiple words with refs switching'
do
expected_result
=
'Use `snake_case` for naming files'
search
=
'for naming files'
fill_in
(
'dashboard_search'
,
with:
search
)
find
(
'.btn-search'
).
click
page
.
within
(
'.results'
)
do
expect
(
find
(
'.search-results'
)).
to
have_content
(
expected_result
)
end
find
(
'.js-project-refs-dropdown'
).
click
find
(
'.dropdown-page-one .dropdown-content'
).
click_link
(
'v1.0.0'
)
page
.
within
(
'.results'
)
do
expect
(
find
(
:css
,
'.search-results'
)).
to
have_content
(
expected_result
)
end
expect
(
find_field
(
'dashboard_search'
).
value
).
to
eq
(
search
)
end
end
end
context
'search code within refs'
,
:js
do
context
'search code within refs'
,
:js
do
...
...
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