diff options
author | Semyon Pupkov <mail@semyonpupkov.com> | 2017-01-03 13:18:48 +0500 |
---|---|---|
committer | Semyon Pupkov <mail@semyonpupkov.com> | 2017-01-03 13:53:42 +0500 |
commit | 4141e30505b1d045317744f27131f2e054ec664a (patch) | |
tree | 2a1423537b9b582d9362059dd8103ea079d94dcb /spec | |
parent | 8dc2163ce580f1d71be1cf45e5dfcb2b4763d7bb (diff) | |
download | gitlab-ce-4141e30505b1d045317744f27131f2e054ec664a.tar.gz |
Move admin deploy keys spinach to rspec
Diffstat (limited to 'spec')
-rw-r--r-- | spec/features/admin/admin_deploy_keys_spec.rb | 37 |
1 files changed, 29 insertions, 8 deletions
diff --git a/spec/features/admin/admin_deploy_keys_spec.rb b/spec/features/admin/admin_deploy_keys_spec.rb index 8bf68480785..7ce6cce0a5c 100644 --- a/spec/features/admin/admin_deploy_keys_spec.rb +++ b/spec/features/admin/admin_deploy_keys_spec.rb @@ -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 - visit admin_deploy_keys_path + describe 'create new deploy key' do + before do + visit admin_deploy_keys_path + click_link 'New Deploy Key' + 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 - 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' - click_button 'Create' + def expect_renders_new_key + expect(current_path).to eq admin_deploy_keys_path + expect(page).to have_content('laptop') + end - expect(current_path).to eq admin_deploy_keys_path - expect(page).to have_content('laptop') + 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 |