summaryrefslogtreecommitdiff
path: root/features/steps
diff options
context:
space:
mode:
authorblackst0ne <blackst0ne.ru@gmail.com>2018-05-09 23:07:23 +0000
committerRobert Speicher <robert@gitlab.com>2018-05-09 23:07:23 +0000
commit3b21da84052738ed6114401fe363cf4b98a57030 (patch)
tree2c35695da1abcfccf12eb6a922643005a7e4375c /features/steps
parent1a9f90f8c132feb5760720931597e1bff28d386d (diff)
downloadgitlab-ce-3b21da84052738ed6114401fe363cf4b98a57030.tar.gz
Replace the `project/deploy_keys.feature` spinach test with an rspec analog
Diffstat (limited to 'features/steps')
-rw-r--r--features/steps/project/deploy_keys.rb94
-rw-r--r--features/steps/shared/paths.rb4
2 files changed, 0 insertions, 98 deletions
diff --git a/features/steps/project/deploy_keys.rb b/features/steps/project/deploy_keys.rb
deleted file mode 100644
index 8e2f594328d..00000000000
--- a/features/steps/project/deploy_keys.rb
+++ /dev/null
@@ -1,94 +0,0 @@
-class Spinach::Features::ProjectDeployKeys < Spinach::FeatureSteps
- include SharedAuthentication
- include SharedProject
- include SharedPaths
-
- step 'project has deploy key' do
- create(:deploy_keys_project, project: @project)
- end
-
- step 'I should see project deploy key' do
- page.within(find('.deploy-keys')) do
- find('.js-deployKeys-tab-enabled_keys').click()
- expect(page).to have_content deploy_key.title
- end
- end
-
- step 'I should see other project deploy key' do
- page.within(find('.deploy-keys')) do
- find('.js-deployKeys-tab-available_project_keys').click()
- expect(page).to have_content other_deploy_key.title
- end
- end
-
- step 'I should see public deploy key' do
- page.within(find('.deploy-keys')) do
- find('.js-deployKeys-tab-public_keys').click()
- expect(page).to have_content public_deploy_key.title
- end
- end
-
- step 'I click \'New Deploy Key\'' do
- click_link 'New deploy key'
- end
-
- step 'I submit new deploy key' do
- 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 "Add key"
- end
-
- step 'I should be on deploy keys page' do
- expect(current_path).to eq project_settings_repository_path(@project)
- end
-
- step 'I should see newly created deploy key' do
- @project.reload
- page.within(find('.deploy-keys')) do
- find('.js-deployKeys-tab-enabled_keys').click()
- expect(page).to have_content(deploy_key.title)
- end
- end
-
- step 'other projects have deploy keys' do
- @second_project = create(:project, namespace: create(:group))
- @second_project.add_master(current_user)
- create(:deploy_keys_project, project: @second_project)
-
- @third_project = create(:project, namespace: create(:group))
- @third_project.add_master(current_user)
- 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
- page.within(find('.deploy-keys')) do
- expect(find('.js-deployKeys-tab-available_project_keys .badge')).to have_content('1')
- end
- end
-
- step 'public deploy key exists' do
- create(:deploy_key, public: true)
- end
-
- step 'I click attach deploy key' do
- page.within(find('.deploy-keys')) do
- find('.badge', text: '1').click()
- click_button 'Enable'
- expect(page).not_to have_selector('.fa-spinner')
- end
- end
-
- protected
-
- def deploy_key
- @project.deploy_keys.last
- end
-
- def other_deploy_key
- @second_project.deploy_keys.last
- end
-
- def public_deploy_key
- DeployKey.are_public.last
- end
-end
diff --git a/features/steps/shared/paths.rb b/features/steps/shared/paths.rb
index f2769f28fed..a6bf7008955 100644
--- a/features/steps/shared/paths.rb
+++ b/features/steps/shared/paths.rb
@@ -240,10 +240,6 @@ module SharedPaths
visit project_settings_integrations_path(@project)
end
- step 'I visit project deploy keys page' do
- visit project_deploy_keys_path(@project)
- end
-
step 'I visit project find file page' do
visit project_find_file_path(@project, root_ref)
end