diff options
author | Marin Jankovski <maxlazio@gmail.com> | 2014-12-29 18:40:25 +0100 |
---|---|---|
committer | Marin Jankovski <maxlazio@gmail.com> | 2014-12-29 18:40:25 +0100 |
commit | c1e57b47b81db4b3959b0ce63d7f65cb6cdf6f57 (patch) | |
tree | 71af4716a35422279ab1c1cba938e7af2a54661a /features | |
parent | f0085d034b33adc78753e2952a5e04842ca979e3 (diff) | |
download | gitlab-ce-c1e57b47b81db4b3959b0ce63d7f65cb6cdf6f57.tar.gz |
Add feature spec for user ssh keys on admin page.
Diffstat (limited to 'features')
-rw-r--r-- | features/admin/users.feature | 10 | ||||
-rw-r--r-- | features/steps/admin/users.rb | 32 |
2 files changed, 42 insertions, 0 deletions
diff --git a/features/admin/users.feature b/features/admin/users.feature index 278f6a43e94..1a8720dd77e 100644 --- a/features/admin/users.feature +++ b/features/admin/users.feature @@ -35,3 +35,13 @@ Feature: Admin Users And I see the secondary email When I click remove secondary email Then I should not see secondary email anymore + + Scenario: Show user keys + Given user "Pete" with ssh keys + And I visit admin users page + And click on user "Pete" + Then I should see key list + And I click on the key title + Then I should see key details + And I click on remove key + Then I should see the key removed diff --git a/features/steps/admin/users.rb b/features/steps/admin/users.rb index 546c1bf2a12..e1383097248 100644 --- a/features/steps/admin/users.rb +++ b/features/steps/admin/users.rb @@ -82,4 +82,36 @@ class Spinach::Features::AdminUsers < Spinach::FeatureSteps page.should have_content 'Account' page.should have_content 'Personal projects limit' end + + step 'user "Pete" with ssh keys' do + user = create(:user, name: 'Pete') + create(:key, user: user, title: "ssh-rsa Key1", key: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC4FIEBXGi4bPU8kzxMefudPIJ08/gNprdNTaO9BR/ndy3+58s2HCTw2xCHcsuBmq+TsAqgEidVq4skpqoTMB+Uot5Uzp9z4764rc48dZiI661izoREoKnuRQSsRqUTHg5wrLzwxlQbl1MVfRWQpqiz/5KjBC7yLEb9AbusjnWBk8wvC1bQPQ1uLAauEA7d836tgaIsym9BrLsMVnR4P1boWD3Xp1B1T/ImJwAGHvRmP/ycIqmKdSpMdJXwxcb40efWVj0Ibbe7ii9eeoLdHACqevUZi6fwfbymdow+FeqlkPoHyGg3Cu4vD/D8+8cRc7mE/zGCWcQ15Var83Tczour Key1") + create(:key, user: user, title: "ssh-rsa Key2", key: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDQSTWXhJAX/He+nG78MiRRRn7m0Pb0XbcgTxE0etArgoFoh9WtvDf36HG6tOSg/0UUNcp0dICsNAmhBKdncp6cIyPaXJTURPRAGvhI0/VDk4bi27bRnccGbJ/hDaUxZMLhhrzY0r22mjVf8PF6dvv5QUIQVm1/LeaWYsHHvLgiIjwrXirUZPnFrZw6VLREoBKG8uWvfSXw1L5eapmstqfsME8099oi+vWLR8MgEysZQmD28M73fgW4zek6LDQzKQyJx9nB+hJkKUDvcuziZjGmRFlNgSA2mguERwL1OXonD8WYUrBDGKroIvBT39zS5d9tQDnidEJZ9Y8gv5ViYP7x Key2") + end + + step 'click on user "Pete"' do + click_link 'Pete' + end + + step 'I should see key list' do + page.should have_content 'ssh-rsa Key2' + page.should have_content 'ssh-rsa Key1' + end + + step 'I click on the key title' do + click_link 'ssh-rsa Key2' + end + + step 'I should see key details' do + page.should have_content 'ssh-rsa Key2' + page.should have_content 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDQSTWXhJAX/He+nG78MiRRRn7m0Pb0XbcgTxE0etArgoFoh9WtvDf36HG6tOSg/0UUNcp0dICsNAmhBKdncp6cIyPaXJTURPRAGvhI0/VDk4bi27bRnccGbJ/hDaUxZMLhhrzY0r22mjVf8PF6dvv5QUIQVm1/LeaWYsHHvLgiIjwrXirUZPnFrZw6VLREoBKG8uWvfSXw1L5eapmstqfsME8099oi+vWLR8MgEysZQmD28M73fgW4zek6LDQzKQyJx9nB+hJkKUDvcuziZjGmRFlNgSA2mguERwL1OXonD8WYUrBDGKroIvBT39zS5d9tQDnidEJZ9Y8gv5ViYP7x Key2' + end + + step 'I click on remove key' do + click_link 'Remove' + end + + step 'I should see the key removed' do + page.should_not have_content 'ssh-rsa Key2' + end end |