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
357ab10d
Commit
357ab10d
authored
Apr 28, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed some spinach & rspec tests
parent
0b7824d4
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
13 deletions
+32
-13
app/assets/javascripts/deploy_keys/components/app.vue
app/assets/javascripts/deploy_keys/components/app.vue
+1
-1
features/project/deploy_keys.feature
features/project/deploy_keys.feature
+6
-0
features/steps/project/deploy_keys.rb
features/steps/project/deploy_keys.rb
+9
-7
spec/features/projects/deploy_keys_spec.rb
spec/features/projects/deploy_keys_spec.rb
+8
-4
spec/serializers/deploy_key_entity_spec.rb
spec/serializers/deploy_key_entity_spec.rb
+8
-1
No files found.
app/assets/javascripts/deploy_keys/components/app.vue
View file @
357ab10d
...
@@ -77,7 +77,7 @@
...
@@ -77,7 +77,7 @@
</
script
>
</
script
>
<
template
>
<
template
>
<div
class=
"col-lg-9 col-lg-offset-3 append-bottom-default"
>
<div
class=
"col-lg-9 col-lg-offset-3 append-bottom-default
deploy-keys
"
>
<div
<div
class=
"text-center"
class=
"text-center"
v-if=
"isLoading && !hasKeys"
>
v-if=
"isLoading && !hasKeys"
>
...
...
features/project/deploy_keys.feature
View file @
357ab10d
...
@@ -3,28 +3,33 @@ Feature: Project Deploy Keys
...
@@ -3,28 +3,33 @@ Feature: Project Deploy Keys
Given
I sign in as a user
Given
I sign in as a user
And
I own project
"Shop"
And
I own project
"Shop"
@javascript
Scenario
:
I
should see deploy keys list
Scenario
:
I
should see deploy keys list
Given
project has deploy key
Given
project has deploy key
When
I visit project deploy keys page
When
I visit project deploy keys page
Then
I should see project deploy key
Then
I should see project deploy key
@javascript
Scenario
:
I
should see project deploy keys
Scenario
:
I
should see project deploy keys
Given
other projects have deploy keys
Given
other projects have deploy keys
When
I visit project deploy keys page
When
I visit project deploy keys page
Then
I should see other project deploy key
Then
I should see other project deploy key
And
I should only see the same deploy key once
And
I should only see the same deploy key once
@javascript
Scenario
:
I
should see public deploy keys
Scenario
:
I
should see public deploy keys
Given
public deploy key exists
Given
public deploy key exists
When
I visit project deploy keys page
When
I visit project deploy keys page
Then
I should see public deploy key
Then
I should see public deploy key
@javascript
Scenario
:
I
add new deploy key
Scenario
:
I
add new deploy key
Given
I visit project deploy keys page
Given
I visit project deploy keys page
And
I submit new deploy key
And
I submit new deploy key
Then
I should be on deploy keys page
Then
I should be on deploy keys page
And
I should see newly created deploy key
And
I should see newly created deploy key
@javascript
Scenario
:
I
attach other project deploy key to project
Scenario
:
I
attach other project deploy key to project
Given
other projects have deploy keys
Given
other projects have deploy keys
And
I visit project deploy keys page
And
I visit project deploy keys page
...
@@ -32,6 +37,7 @@ Feature: Project Deploy Keys
...
@@ -32,6 +37,7 @@ Feature: Project Deploy Keys
Then
I should be on deploy keys page
Then
I should be on deploy keys page
And
I should see newly created deploy key
And
I should see newly created deploy key
@javascript
Scenario
:
I
attach public deploy key to project
Scenario
:
I
attach public deploy key to project
Given
public deploy key exists
Given
public deploy key exists
And
I visit project deploy keys page
And
I visit project deploy keys page
...
...
features/steps/project/deploy_keys.rb
View file @
357ab10d
...
@@ -8,19 +8,19 @@ class Spinach::Features::ProjectDeployKeys < Spinach::FeatureSteps
...
@@ -8,19 +8,19 @@ class Spinach::Features::ProjectDeployKeys < Spinach::FeatureSteps
end
end
step
'I should see project deploy key'
do
step
'I should see project deploy key'
do
page
.
within
'.deploy-keys'
do
page
.
within
(
find
(
'.deploy-keys'
))
do
expect
(
page
).
to
have_content
deploy_key
.
title
expect
(
page
).
to
have_content
deploy_key
.
title
end
end
end
end
step
'I should see other project deploy key'
do
step
'I should see other project deploy key'
do
page
.
within
'.deploy-keys'
do
page
.
within
(
find
(
'.deploy-keys'
))
do
expect
(
page
).
to
have_content
other_deploy_key
.
title
expect
(
page
).
to
have_content
other_deploy_key
.
title
end
end
end
end
step
'I should see public deploy key'
do
step
'I should see public deploy key'
do
page
.
within
'.deploy-keys'
do
page
.
within
(
find
(
'.deploy-keys'
))
do
expect
(
page
).
to
have_content
public_deploy_key
.
title
expect
(
page
).
to
have_content
public_deploy_key
.
title
end
end
end
end
...
@@ -40,7 +40,8 @@ class Spinach::Features::ProjectDeployKeys < Spinach::FeatureSteps
...
@@ -40,7 +40,8 @@ class Spinach::Features::ProjectDeployKeys < Spinach::FeatureSteps
end
end
step
'I should see newly created deploy key'
do
step
'I should see newly created deploy key'
do
page
.
within
'.deploy-keys'
do
@project
.
reload
page
.
within
(
find
(
'.deploy-keys'
))
do
expect
(
page
).
to
have_content
(
deploy_key
.
title
)
expect
(
page
).
to
have_content
(
deploy_key
.
title
)
end
end
end
end
...
@@ -56,7 +57,7 @@ class Spinach::Features::ProjectDeployKeys < Spinach::FeatureSteps
...
@@ -56,7 +57,7 @@ class Spinach::Features::ProjectDeployKeys < Spinach::FeatureSteps
end
end
step
'I should only see the same deploy key once'
do
step
'I should only see the same deploy key once'
do
page
.
within
'.deploy-keys'
do
page
.
within
(
find
(
'.deploy-keys'
))
do
expect
(
page
).
to
have_selector
(
'ul li'
,
count:
1
)
expect
(
page
).
to
have_selector
(
'ul li'
,
count:
1
)
end
end
end
end
...
@@ -66,8 +67,9 @@ class Spinach::Features::ProjectDeployKeys < Spinach::FeatureSteps
...
@@ -66,8 +67,9 @@ class Spinach::Features::ProjectDeployKeys < Spinach::FeatureSteps
end
end
step
'I click attach deploy key'
do
step
'I click attach deploy key'
do
page
.
within
'.deploy-keys'
do
page
.
within
(
find
(
'.deploy-keys'
))
do
click_link
'Enable'
click_button
'Enable'
expect
(
page
).
not_to
have_selector
(
'.fa-spinner'
)
end
end
end
end
...
...
spec/features/projects/deploy_keys_spec.rb
View file @
357ab10d
require
'spec_helper'
require
'spec_helper'
describe
'Project deploy keys'
,
feature:
tru
e
do
describe
'Project deploy keys'
,
:js
,
:featur
e
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project_empty_repo
)
}
let
(
:project
)
{
create
(
:project_empty_repo
)
}
...
@@ -17,9 +17,13 @@ describe 'Project deploy keys', feature: true do
...
@@ -17,9 +17,13 @@ describe 'Project deploy keys', feature: true do
it
'removes association between project and deploy key'
do
it
'removes association between project and deploy key'
do
visit
namespace_project_settings_repository_path
(
project
.
namespace
,
project
)
visit
namespace_project_settings_repository_path
(
project
.
namespace
,
project
)
page
.
within
'.deploy-keys'
do
page
.
within
(
find
(
'.deploy-keys'
))
do
expect
{
click_on
'Remove'
}
expect
(
page
).
to
have_selector
(
'.deploy-keys li'
,
count:
1
)
.
to
change
{
project
.
deploy_keys
.
count
}.
by
(
-
1
)
click_on
'Remove'
expect
(
page
).
not_to
have_selector
(
'.fa-spinner'
,
count:
0
)
expect
(
page
).
to
have_selector
(
'.deploy-keys li'
,
count:
0
)
end
end
end
end
end
end
...
...
spec/serializers/deploy_key_entity_spec.rb
View file @
357ab10d
require
'spec_helper'
require
'spec_helper'
describe
DeployKeyEntity
do
describe
DeployKeyEntity
do
include
RequestAwareEntity
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:empty_project
,
:internal
)}
let
(
:project
)
{
create
(
:empty_project
,
:internal
)}
let
(
:project_private
)
{
create
(
:empty_project
,
:private
)}
let
(
:project_private
)
{
create
(
:empty_project
,
:private
)}
...
@@ -22,7 +24,12 @@ describe DeployKeyEntity do
...
@@ -22,7 +24,12 @@ describe DeployKeyEntity do
created_at:
deploy_key
.
created_at
,
created_at:
deploy_key
.
created_at
,
updated_at:
deploy_key
.
updated_at
,
updated_at:
deploy_key
.
updated_at
,
projects:
[
projects:
[
{
id:
project
.
id
,
name:
project
.
name
,
full_path:
project
.
full_path
,
full_name:
project
.
full_name
}
{
id:
project
.
id
,
name:
project
.
name
,
full_path:
namespace_project_path
(
project
.
namespace
,
project
),
full_name:
project
.
full_name
}
]
]
}
}
...
...
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