diff options
author | blackst0ne <blackst0ne.ru@gmail.com> | 2018-04-11 11:46:31 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2018-04-11 11:46:31 +0000 |
commit | 6d9f16c0aba46edd45d194e6f919896359b98a03 (patch) | |
tree | 6946a380cd79a9f74ff072d88d3c3a5cb2f6b92c /features | |
parent | 3efe170370c5ea6bbf68ab497339e4360af84030 (diff) | |
download | gitlab-ce-6d9f16c0aba46edd45d194e6f919896359b98a03.tar.gz |
Replace the `project/commits/branches.feature` spinach test with an rspec analog
Diffstat (limited to 'features')
-rw-r--r-- | features/project/commits/branches.feature | 42 | ||||
-rw-r--r-- | features/steps/project/commits/branches.rb | 57 | ||||
-rw-r--r-- | features/steps/shared/paths.rb | 8 |
3 files changed, 0 insertions, 107 deletions
diff --git a/features/project/commits/branches.feature b/features/project/commits/branches.feature deleted file mode 100644 index c57376aecff..00000000000 --- a/features/project/commits/branches.feature +++ /dev/null @@ -1,42 +0,0 @@ -@project_commits -Feature: Project Commits Branches - Background: - Given I sign in as a user - And I own project "Shop" - And project "Shop" has protected branches - - Scenario: I can see project all git branches - Given I visit project branches page - Then I should see "Shop" all branches list - - Scenario: I can see project protected git branches - Given I visit project protected branches page - Then I should see "Shop" protected branches list - - @javascript - Scenario: I create a branch - Given I visit project branches page - And I click new branch link - And I submit new branch form - Then I should see new branch created - - @javascript - Scenario: I delete a branch - Given I visit project branches page - And I filter for branch improve/awesome - And I click branch 'improve/awesome' delete link - Then I should not see branch 'improve/awesome' - - @javascript - Scenario: I create a branch with invalid name - Given I visit project branches page - And I click new branch link - And I submit new branch form with invalid name - Then I should see new an error that branch is invalid - - @javascript - Scenario: I create a branch that already exists - Given I visit project branches page - And I click new branch link - And I submit new branch form with branch that already exists - Then I should see new an error that branch already exists diff --git a/features/steps/project/commits/branches.rb b/features/steps/project/commits/branches.rb index c3ae33d2aa9..3ecd4c8b672 100644 --- a/features/steps/project/commits/branches.rb +++ b/features/steps/project/commits/branches.rb @@ -7,37 +7,14 @@ class Spinach::Features::ProjectCommitsBranches < Spinach::FeatureSteps click_link "All" end - step 'I should see "Shop" all branches list' do - expect(page).to have_content "Branches" - expect(page).to have_content "master" - end - step 'I click link "Protected"' do click_link "Protected" end - step 'I should see "Shop" protected branches list' do - page.within ".protected-branches-list" do - expect(page).to have_content "stable" - expect(page).not_to have_content "master" - end - end - - step 'project "Shop" has protected branches' do - project = Project.find_by(name: "Shop") - create(:protected_branch, project: project, name: "stable") - end - step 'I click new branch link' do click_link "New branch" end - step 'I submit new branch form' do - fill_in 'branch_name', with: 'deploy_keys' - select_branch('master') - click_button 'Create branch' - end - step 'I submit new branch form with invalid name' do fill_in 'branch_name', with: '1.0 stable' page.find("body").click # defocus the branch_name input @@ -45,40 +22,6 @@ class Spinach::Features::ProjectCommitsBranches < Spinach::FeatureSteps click_button 'Create branch' end - step 'I submit new branch form with branch that already exists' do - fill_in 'branch_name', with: 'master' - select_branch('master') - click_button 'Create branch' - end - - step 'I should see new branch created' do - expect(page).to have_content 'deploy_keys' - end - - step 'I should see new an error that branch is invalid' do - expect(page).to have_content 'Branch name is invalid' - expect(page).to have_content "can't contain spaces" - end - - step 'I should see new an error that branch already exists' do - expect(page).to have_content 'Branch already exists' - end - - step 'I filter for branch improve/awesome' do - fill_in 'branch-search', with: 'improve/awesome' - find('#branch-search').native.send_keys(:enter) - end - - step "I click branch 'improve/awesome' delete link" do - page.within '.js-branch-improve\/awesome' do - accept_alert { find('.btn-remove').click } - end - end - - step "I should not see branch 'improve/awesome'" do - expect(page).to have_css('.js-branch-improve\\/awesome', visible: :hidden) - end - def select_branch(branch_name) find('.git-revision-dropdown-toggle').click diff --git a/features/steps/shared/paths.rb b/features/steps/shared/paths.rb index cc893b8391e..4ba83499e3c 100644 --- a/features/steps/shared/paths.rb +++ b/features/steps/shared/paths.rb @@ -276,14 +276,6 @@ module SharedPaths visit edit_project_path(project) end - step 'I visit project branches page' do - visit project_branches_path(@project) - end - - step 'I visit project protected branches page' do - visit project_protected_branches_path(@project) - end - step 'I visit compare refs page' do visit project_compare_index_path(@project) end |