diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2016-11-22 16:06:42 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2016-11-22 17:31:27 +0800 |
commit | 28102ec28e1ef3d3203db3d05aa89ab3da234e70 (patch) | |
tree | 522d3d898cdf12f947f4d08f3d5487284eb244dc /features | |
parent | 60fe975452f6781198188ae985bad7329d1aff05 (diff) | |
download | gitlab-ce-28102ec28e1ef3d3203db3d05aa89ab3da234e70.tar.gz |
Allow admin to set keys with write access, and
show write access information when showing the key.
TODO: It's ugly right now, need help!
Diffstat (limited to 'features')
-rw-r--r-- | features/admin/deploy_keys.feature | 9 | ||||
-rw-r--r-- | features/steps/admin/deploy_keys.rb | 15 |
2 files changed, 22 insertions, 2 deletions
diff --git a/features/admin/deploy_keys.feature b/features/admin/deploy_keys.feature index 33439cd1e85..95ac77cddd2 100644 --- a/features/admin/deploy_keys.feature +++ b/features/admin/deploy_keys.feature @@ -13,4 +13,11 @@ Feature: Admin Deploy Keys 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 + 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 diff --git a/features/steps/admin/deploy_keys.rb b/features/steps/admin/deploy_keys.rb index 56787eeb6b3..79312a5d1c5 100644 --- a/features/steps/admin/deploy_keys.rb +++ b/features/steps/admin/deploy_keys.rb @@ -32,12 +32,25 @@ class Spinach::Features::AdminDeployKeys < Spinach::FeatureSteps 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' do + 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 |