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
8ad7cb77
Commit
8ad7cb77
authored
Apr 24, 2018
by
Semyon Pupkov
Committed by
Rémy Coutable
Apr 24, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace find file project spinach tests with RSpec
parent
a544f6ec
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
66 additions
and
118 deletions
+66
-118
features/project/find_file.feature
features/project/find_file.feature
+0
-42
features/steps/project/project_find_file.rb
features/steps/project/project_find_file.rb
+0
-72
features/steps/shared/paths.rb
features/steps/shared/paths.rb
+0
-4
spec/features/projects/files/user_find_file_spec.rb
spec/features/projects/files/user_find_file_spec.rb
+66
-0
No files found.
features/project/find_file.feature
deleted
100644 → 0
View file @
a544f6ec
@dashboard
Feature
:
Project Find File
Background
:
Given
I sign in as a user
And
I own a project
And
I visit my project's files page
@javascript
Scenario
:
Navigate to find file by shortcut
Given
I press
"t"
Then
I should see
"find file"
page
Scenario
:
Navigate to find file
Given
I click Find File button
Then
I should see
"find file"
page
@javascript
Scenario
:
I
search file
Given
I visit project find file page
And
I fill in file find with
"change"
Then
I should not see
".gitignore"
in files
And
I should not see
".gitmodules"
in files
And
I should see
"CHANGELOG"
in files
And
I should not see
"VERSION"
in files
@javascript
Scenario
:
I
search file that not exist
Given
I visit project find file page
And
I fill in file find with
"asdfghjklqwertyuizxcvbnm"
Then
I should not see
".gitignore"
in files
And
I should not see
".gitmodules"
in files
And
I should not see
"CHANGELOG"
in files
And
I should not see
"VERSION"
in files
@javascript
Scenario
:
I
search file that partially matches
Given
I visit project find file page
And
I fill in file find with
"git"
Then
I should see
".gitignore"
in files
And
I should see
".gitmodules"
in files
And
I should not see
"CHANGELOG"
in files
And
I should not see
"VERSION"
in files
features/steps/project/project_find_file.rb
deleted
100644 → 0
View file @
a544f6ec
class
Spinach::Features::ProjectFindFile
<
Spinach
::
FeatureSteps
include
SharedAuthentication
include
SharedPaths
include
SharedProject
include
SharedProjectTab
step
'I press "t"'
do
find
(
'body'
).
native
.
send_key
(
't'
)
end
step
'I click Find File button'
do
click_link
'Find file'
end
step
'I should see "find file" page'
do
ensure_active_main_tab
(
'Repository'
)
expect
(
page
).
to
have_selector
(
'.file-finder-holder'
,
count:
1
)
end
step
'I fill in Find by path with "git"'
do
ensure_active_main_tab
(
'Repository'
)
expect
(
page
).
to
have_selector
(
'.file-finder-holder'
,
count:
1
)
end
step
'I fill in file find with "git"'
do
find_file
"git"
end
step
'I fill in file find with "change"'
do
find_file
"change"
end
step
'I fill in file find with "asdfghjklqwertyuizxcvbnm"'
do
find_file
"asdfghjklqwertyuizxcvbnm"
end
step
'I should see "VERSION" in files'
do
expect
(
page
).
to
have_content
(
"VERSION"
)
end
step
'I should not see "VERSION" in files'
do
expect
(
page
).
not_to
have_content
(
"VERSION"
)
end
step
'I should see "CHANGELOG" in files'
do
expect
(
page
).
to
have_content
(
"CHANGELOG"
)
end
step
'I should not see "CHANGELOG" in files'
do
expect
(
page
).
not_to
have_content
(
"CHANGELOG"
)
end
step
'I should see ".gitmodules" in files'
do
expect
(
page
).
to
have_content
(
".gitmodules"
)
end
step
'I should not see ".gitmodules" in files'
do
expect
(
page
).
not_to
have_content
(
".gitmodules"
)
end
step
'I should see ".gitignore" in files'
do
expect
(
page
).
to
have_content
(
".gitignore"
)
end
step
'I should not see ".gitignore" in files'
do
expect
(
page
).
not_to
have_content
(
".gitignore"
)
end
def
find_file
(
text
)
fill_in
'file_find'
,
with:
text
end
end
features/steps/shared/paths.rb
View file @
8ad7cb77
...
...
@@ -200,10 +200,6 @@ module SharedPaths
visit
edit_project_path
(
@project
)
end
step
"I visit my project's files page"
do
visit
project_tree_path
(
@project
,
root_ref
)
end
step
'I visit a binary file in the repo'
do
visit
project_blob_path
(
@project
,
File
.
join
(
root_ref
,
'files/images/logo-black.png'
))
...
...
spec/features/projects/files/user_find_file_spec.rb
0 → 100644
View file @
8ad7cb77
require
'spec_helper'
describe
'User find project file'
do
let
(
:user
)
{
create
:user
}
let
(
:project
)
{
create
:project
,
:repository
}
before
do
sign_in
(
user
)
project
.
add_master
(
user
)
visit
project_tree_path
(
project
,
project
.
repository
.
root_ref
)
end
def
active_main_tab
find
(
'.sidebar-top-level-items > li.active'
)
end
def
find_file
(
text
)
fill_in
'file_find'
,
with:
text
end
it
'navigates to find file by shortcut'
,
:js
do
find
(
'body'
).
native
.
send_key
(
't'
)
expect
(
active_main_tab
).
to
have_content
(
'Repository'
)
expect
(
page
).
to
have_selector
(
'.file-finder-holder'
,
count:
1
)
end
it
'navigates to find file'
do
click_link
'Find file'
expect
(
active_main_tab
).
to
have_content
(
'Repository'
)
expect
(
page
).
to
have_selector
(
'.file-finder-holder'
,
count:
1
)
end
it
'searches CHANGELOG file'
,
:js
do
click_link
'Find file'
find_file
'change'
expect
(
page
).
to
have_content
(
'CHANGELOG'
)
expect
(
page
).
not_to
have_content
(
'.gitignore'
)
expect
(
page
).
not_to
have_content
(
'VERSION'
)
end
it
'does not find file when search not exist file'
,
:js
do
click_link
'Find file'
find_file
'asdfghjklqwertyuizxcvbnm'
expect
(
page
).
not_to
have_content
(
'CHANGELOG'
)
expect
(
page
).
not_to
have_content
(
'.gitignore'
)
expect
(
page
).
not_to
have_content
(
'VERSION'
)
end
it
'searches file by partially matches'
,
:js
do
click_link
'Find file'
find_file
'git'
expect
(
page
).
to
have_content
(
'.gitignore'
)
expect
(
page
).
to
have_content
(
'.gitmodules'
)
expect
(
page
).
not_to
have_content
(
'CHANGELOG'
)
expect
(
page
).
not_to
have_content
(
'VERSION'
)
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