summaryrefslogtreecommitdiff
path: root/features
diff options
context:
space:
mode:
authorMaran <maran.hidskes@gmail.com>2015-05-08 15:03:26 +0200
committerMaran <maran.hidskes@gmail.com>2015-05-08 21:32:03 +0200
commita0fd2eb568cdbe3537f10a83191fde893a5d6fcd (patch)
treedee6d4dd8130083eb9a8e7c9168bb7d4efc1a427 /features
parent6c32abc5f7f090d4932054e5cc1ff0594edd5ff1 (diff)
downloadgitlab-ce-a0fd2eb568cdbe3537f10a83191fde893a5d6fcd.tar.gz
Don't show duplicate deploy keys. Fixes #1516
Diffstat (limited to 'features')
-rw-r--r--features/project/deploy_keys.feature7
-rw-r--r--features/steps/project/deploy_keys.rb14
2 files changed, 16 insertions, 5 deletions
diff --git a/features/project/deploy_keys.feature b/features/project/deploy_keys.feature
index a71f6124d9c..47cf774094f 100644
--- a/features/project/deploy_keys.feature
+++ b/features/project/deploy_keys.feature
@@ -9,9 +9,10 @@ Feature: Project Deploy Keys
Then I should see project deploy key
Scenario: I should see project deploy keys
- Given other project has deploy key
+ Given other projects have deploy keys
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
Scenario: I should see public deploy keys
Given public deploy key exists
@@ -26,7 +27,7 @@ Feature: Project Deploy Keys
And I should see newly created deploy key
Scenario: I attach other project deploy key to project
- Given other project has deploy key
+ Given other projects have deploy keys
And I visit project deploy keys page
When I click attach deploy key
Then I should be on deploy keys page
diff --git a/features/steps/project/deploy_keys.rb b/features/steps/project/deploy_keys.rb
index 50e14513a7a..81d1182cd1b 100644
--- a/features/steps/project/deploy_keys.rb
+++ b/features/steps/project/deploy_keys.rb
@@ -45,10 +45,20 @@ class Spinach::Features::ProjectDeployKeys < Spinach::FeatureSteps
end
end
- step 'other project has deploy key' do
- @second_project = create :project, namespace: create(:group)
+ step 'other projects have deploy keys' do
+ @second_project = create(:project, namespace: create(:group))
@second_project.team << [current_user, :master]
create(:deploy_keys_project, project: @second_project)
+
+ @third_project = create(:project, namespace: create(:group))
+ @third_project.team << [current_user, :master]
+ create(:deploy_keys_project, project: @third_project, deploy_key: @second_project.deploy_keys.first)
+ end
+
+ step 'I should only see the same deploy key once' do
+ within '.available-keys' do
+ page.should have_selector('ul li', count: 1)
+ end
end
step 'public deploy key exists' do