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
Tatuya Kamada
gitlab-ce
Commits
6237cae1
Commit
6237cae1
authored
Apr 03, 2015
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add admin deploy keys tests.
parent
9b362407
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
81 additions
and
0 deletions
+81
-0
features/admin/deploy_keys.feature
features/admin/deploy_keys.feature
+21
-0
features/steps/admin/deploy_keys.rb
features/steps/admin/deploy_keys.rb
+57
-0
spec/factories.rb
spec/factories.rb
+3
-0
No files found.
features/admin/deploy_keys.feature
0 → 100644
View file @
6237cae1
@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 show
When
I visit admin deploy keys page
And
I click on first deploy key
Then
I should see deploy key details
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
features/steps/admin/deploy_keys.rb
0 → 100644
View file @
6237cae1
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
|
page
.
should
have_content
p
.
title
end
end
step
'I click on first deploy key'
do
click_link
DeployKey
.
are_public
.
first
.
title
end
step
'I should see deploy key details'
do
deploy_key
=
DeployKey
.
are_public
.
first
current_path
.
should
==
admin_deploy_key_path
(
deploy_key
)
page
.
should
have_content
(
deploy_key
.
title
)
page
.
should
have_content
(
deploy_key
.
key
)
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 should be on admin deploy keys page'
do
current_path
.
should
==
admin_deploy_keys_path
end
step
'I should see newly created deploy key'
do
page
.
should
have_content
(
deploy_key
.
title
)
end
def
deploy_key
@deploy_key
||=
DeployKey
.
are_public
.
first
end
end
spec/factories.rb
View file @
6237cae1
...
@@ -111,6 +111,9 @@ FactoryGirl.define do
...
@@ -111,6 +111,9 @@ FactoryGirl.define do
key
do
key
do
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDmTillFzNTrrGgwaCKaSj+QCz81E6jBc/s9av0+3b1Hwfxgkqjl4nAK/OD2NjgyrONDTDfR8cRN4eAAy6nY8GLkOyYBDyuc5nTMqs5z3yVuTwf3koGm/YQQCmo91psZ2BgDFTor8SVEE5Mm1D1k3JDMhDFxzzrOtRYFPci9lskTJaBjpqWZ4E9rDTD2q/QZntCqbC3wE9uSemRQB5f8kik7vD/AD8VQXuzKladrZKkzkONCPWsXDspUitjM8HkQdOf0PsYn1CMUC1xKYbCxkg5TkEosIwGv6CoEArUrdu/4+10LVslq494mAvEItywzrluCLCnwELfW+h/m8UHoVhZ"
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDmTillFzNTrrGgwaCKaSj+QCz81E6jBc/s9av0+3b1Hwfxgkqjl4nAK/OD2NjgyrONDTDfR8cRN4eAAy6nY8GLkOyYBDyuc5nTMqs5z3yVuTwf3koGm/YQQCmo91psZ2BgDFTor8SVEE5Mm1D1k3JDMhDFxzzrOtRYFPci9lskTJaBjpqWZ4E9rDTD2q/QZntCqbC3wE9uSemRQB5f8kik7vD/AD8VQXuzKladrZKkzkONCPWsXDspUitjM8HkQdOf0PsYn1CMUC1xKYbCxkg5TkEosIwGv6CoEArUrdu/4+10LVslq494mAvEItywzrluCLCnwELfW+h/m8UHoVhZ"
end
end
factory
:another_deploy_key
,
class:
'DeployKey'
do
end
end
end
factory
:invalid_key
do
factory
:invalid_key
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