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
4141e305
Commit
4141e305
authored
Jan 03, 2017
by
Semyon Pupkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move admin deploy keys spinach to rspec
parent
8dc2163c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
90 deletions
+29
-90
features/admin/deploy_keys.feature
features/admin/deploy_keys.feature
+0
-23
features/steps/admin/deploy_keys.rb
features/steps/admin/deploy_keys.rb
+0
-59
spec/features/admin/admin_deploy_keys_spec.rb
spec/features/admin/admin_deploy_keys_spec.rb
+29
-8
No files found.
features/admin/deploy_keys.feature
deleted
100644 → 0
View file @
8dc2163c
@admin
Feature
:
Admin Deploy Keys
Background
:
Given
I sign in as an admin
And
there are public deploy keys in system
Scenario
:
Deploy Keys list
When
I visit admin deploy keys page
Then
I should see all public deploy keys
Scenario
:
Deploy Keys new
When
I visit admin deploy keys page
And
I click 'New Deploy Key'
And
I submit new deploy key
Then
I should be on admin deploy keys page
And
I should see newly created deploy key without write access
Scenario
:
Deploy Keys new with write access
When
I visit admin deploy keys page
And
I click 'New Deploy Key'
And
I submit new deploy key with write access
Then
I should be on admin deploy keys page
And
I should see newly created deploy key with write access
features/steps/admin/deploy_keys.rb
deleted
100644 → 0
View file @
8dc2163c
class
Spinach::Features::AdminDeployKeys
<
Spinach
::
FeatureSteps
include
SharedAuthentication
include
SharedPaths
include
SharedAdmin
step
'there are public deploy keys in system'
do
create
(
:deploy_key
,
public:
true
)
create
(
:another_deploy_key
,
public:
true
)
end
step
'I should see all public deploy keys'
do
DeployKey
.
are_public
.
each
do
|
p
|
expect
(
page
).
to
have_content
p
.
title
end
end
step
'I visit admin deploy key page'
do
visit
admin_deploy_key_path
(
deploy_key
)
end
step
'I visit admin deploy keys page'
do
visit
admin_deploy_keys_path
end
step
'I click \'New Deploy Key\''
do
click_link
'New Deploy Key'
end
step
'I submit new deploy key'
do
fill_in
"deploy_key_title"
,
with:
"laptop"
fill_in
"deploy_key_key"
,
with:
"ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAzrEJUIR6Y03TCE9rIJ+GqTBvgb8t1jI9h5UBzCLuK4VawOmkLornPqLDrGbm6tcwM/wBrrLvVOqi2HwmkKEIecVO0a64A4rIYScVsXIniHRS6w5twyn1MD3sIbN+socBDcaldECQa2u1dI3tnNVcs8wi77fiRe7RSxePsJceGoheRQgC8AZ510UdIlO+9rjIHUdVN7LLyz512auAfYsgx1OfablkQ/XJcdEwDNgi9imI6nAXhmoKUm1IPLT2yKajTIC64AjLOnE0YyCh6+7RFMpiMyu1qiOCpdjYwTgBRiciNRZCH8xIedyCoAmiUgkUT40XYHwLuwiPJICpkAzp7Q== user@laptop"
click_button
"Create"
end
step
'I submit new deploy key with write access'
do
fill_in
"deploy_key_title"
,
with:
"server"
fill_in
"deploy_key_key"
,
with:
"ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAzrEJUIR6Y03TCE9rIJ+GqTBvgb8t1jI9h5UBzCLuK4VawOmkLornPqLDrGbm6tcwM/wBrrLvVOqi2HwmkKEIecVO0a64A4rIYScVsXIniHRS6w5twyn1MD3sIbN+socBDcaldECQa2u1dI3tnNVcs8wi77fiRe7RSxePsJceGoheRQgC8AZ510UdIlO+9rjIHUdVN7LLyz512auAfYsgx1OfablkQ/XJcdEwDNgi9imI6nAXhmoKUm1IPLT2yKajTIC64AjLOnE0YyCh6+7RFMpiMyu1qiOCpdjYwTgBRiciNRZCH8xIedyCoAmiUgkUT40XYHwLuwiPJICpkAzp7Q== user@laptop"
check
"deploy_key_can_push"
click_button
"Create"
end
step
'I should be on admin deploy keys page'
do
expect
(
current_path
).
to
eq
admin_deploy_keys_path
end
step
'I should see newly created deploy key without write access'
do
expect
(
page
).
to
have_content
(
deploy_key
.
title
)
expect
(
page
).
to
have_content
(
'No'
)
end
step
'I should see newly created deploy key with write access'
do
expect
(
page
).
to
have_content
(
deploy_key
.
title
)
expect
(
page
).
to
have_content
(
'Yes'
)
end
def
deploy_key
@deploy_key
||=
DeployKey
.
are_public
.
first
end
end
spec/features/admin/admin_deploy_keys_spec.rb
View file @
4141e305
...
...
@@ -15,15 +15,36 @@ RSpec.describe 'admin deploy keys', type: :feature do
expect
(
page
).
to
have_content
(
another_deploy_key
.
title
)
end
it
'creates new deploy key'
do
describe
'create new deploy key'
do
before
do
visit
admin_deploy_keys_path
click_link
'New Deploy Key'
fill_in
'deploy_key_title'
,
with:
'laptop'
fill_in
'deploy_key_key'
,
with:
'ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAzrEJUIR6Y03TCE9rIJ+GqTBvgb8t1jI9h5UBzCLuK4VawOmkLornPqLDrGbm6tcwM/wBrrLvVOqi2HwmkKEIecVO0a64A4rIYScVsXIniHRS6w5twyn1MD3sIbN+socBDcaldECQa2u1dI3tnNVcs8wi77fiRe7RSxePsJceGoheRQgC8AZ510UdIlO+9rjIHUdVN7LLyz512auAfYsgx1OfablkQ/XJcdEwDNgi9imI6nAXhmoKUm1IPLT2yKajTIC64AjLOnE0YyCh6+7RFMpiMyu1qiOCpdjYwTgBRiciNRZCH8xIedyCoAmiUgkUT40XYHwLuwiPJICpkAzp7Q== user@laptop'
end
it
'creates new deploy key'
do
fill_deploy_key
click_button
'Create'
expect_renders_new_key
end
it
'creates new deploy key with write access'
do
fill_deploy_key
check
"deploy_key_can_push"
click_button
"Create"
expect_renders_new_key
expect
(
page
).
to
have_content
(
'Yes'
)
end
def
expect_renders_new_key
expect
(
current_path
).
to
eq
admin_deploy_keys_path
expect
(
page
).
to
have_content
(
'laptop'
)
end
def
fill_deploy_key
fill_in
'deploy_key_title'
,
with:
'laptop'
fill_in
'deploy_key_key'
,
with:
'ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAzrEJUIR6Y03TCE9rIJ+GqTBvgb8t1jI9h5UBzCLuK4VawOmkLornPqLDrGbm6tcwM/wBrrLvVOqi2HwmkKEIecVO0a64A4rIYScVsXIniHRS6w5twyn1MD3sIbN+socBDcaldECQa2u1dI3tnNVcs8wi77fiRe7RSxePsJceGoheRQgC8AZ510UdIlO+9rjIHUdVN7LLyz512auAfYsgx1OfablkQ/XJcdEwDNgi9imI6nAXhmoKUm1IPLT2yKajTIC64AjLOnE0YyCh6+7RFMpiMyu1qiOCpdjYwTgBRiciNRZCH8xIedyCoAmiUgkUT40XYHwLuwiPJICpkAzp7Q== user@laptop'
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