Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorblackst0ne <blackst0ne.ru@gmail.com>2018-05-10 02:07:23 +0300
committerRobert Speicher <robert@gitlab.com>2018-05-10 02:07:23 +0300
commit3b21da84052738ed6114401fe363cf4b98a57030 (patch)
tree2c35695da1abcfccf12eb6a922643005a7e4375c /features
parent1a9f90f8c132feb5760720931597e1bff28d386d (diff)
Replace the `project/deploy_keys.feature` spinach test with an rspec analog
Diffstat (limited to 'features')
-rw-r--r--features/project/deploy_keys.feature46
-rw-r--r--features/steps/project/deploy_keys.rb94
-rw-r--r--features/steps/shared/paths.rb4
3 files changed, 0 insertions, 144 deletions
diff --git a/features/project/deploy_keys.feature b/features/project/deploy_keys.feature
deleted file mode 100644
index 6f1ed9ff5b6..00000000000
--- a/features/project/deploy_keys.feature
+++ /dev/null
@@ -1,46 +0,0 @@
-Feature: Project Deploy Keys
- Background:
- Given I sign in as a user
- And I own project "Shop"
-
- @javascript
- Scenario: I should see deploy keys list
- Given project has deploy key
- When I visit project deploy keys page
- Then I should see project deploy key
-
- @javascript
- Scenario: I should see project deploy keys
- Given other projects have deploy keys
- When I visit project deploy keys page
- Then I should see other project deploy key
- And I should only see the same deploy key once
-
- @javascript
- Scenario: I should see public deploy keys
- Given public deploy key exists
- When I visit project deploy keys page
- Then I should see public deploy key
-
- @javascript
- Scenario: I add new deploy key
- Given I visit project deploy keys page
- And I submit new deploy key
- Then I should be on deploy keys page
- And I should see newly created deploy key
-
- @javascript
- Scenario: I attach other project deploy key to project
- 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
- And I should see newly created deploy key
-
- @javascript
- Scenario: I attach public deploy key to project
- Given public deploy key exists
- And I visit project deploy keys page
- When I click attach deploy key
- Then I should be on deploy keys page
- And I should see newly created deploy key
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