Commit f4c2bc10 authored by Luke Bennett's avatar Luke Bennett

Remove set_defaults in protected_branches_spec

parent 34af8e5a
...@@ -72,7 +72,6 @@ feature 'Protected Branches', :js do ...@@ -72,7 +72,6 @@ feature 'Protected Branches', :js do
describe "explicit protected branches" do describe "explicit protected branches" do
it "allows creating explicit protected branches" do it "allows creating explicit protected branches" do
visit project_protected_branches_path(project) visit project_protected_branches_path(project)
set_defaults
set_protected_branch_name('some-branch') set_protected_branch_name('some-branch')
set_allowed_to('merge') set_allowed_to('merge')
set_allowed_to('push') set_allowed_to('push')
...@@ -88,7 +87,6 @@ feature 'Protected Branches', :js do ...@@ -88,7 +87,6 @@ feature 'Protected Branches', :js do
project.repository.add_branch(admin, 'some-branch', commit.id) project.repository.add_branch(admin, 'some-branch', commit.id)
visit project_protected_branches_path(project) visit project_protected_branches_path(project)
set_defaults
set_protected_branch_name('some-branch') set_protected_branch_name('some-branch')
set_allowed_to('merge') set_allowed_to('merge')
set_allowed_to('push') set_allowed_to('push')
...@@ -99,7 +97,6 @@ feature 'Protected Branches', :js do ...@@ -99,7 +97,6 @@ feature 'Protected Branches', :js do
it "displays an error message if the named branch does not exist" do it "displays an error message if the named branch does not exist" do
visit project_protected_branches_path(project) visit project_protected_branches_path(project)
set_defaults
set_protected_branch_name('some-branch') set_protected_branch_name('some-branch')
set_allowed_to('merge') set_allowed_to('merge')
set_allowed_to('push') set_allowed_to('push')
...@@ -112,7 +109,6 @@ feature 'Protected Branches', :js do ...@@ -112,7 +109,6 @@ feature 'Protected Branches', :js do
describe "wildcard protected branches" do describe "wildcard protected branches" do
it "allows creating protected branches with a wildcard" do it "allows creating protected branches with a wildcard" do
visit project_protected_branches_path(project) visit project_protected_branches_path(project)
set_defaults
set_protected_branch_name('*-stable') set_protected_branch_name('*-stable')
set_allowed_to('merge') set_allowed_to('merge')
set_allowed_to('push') set_allowed_to('push')
...@@ -128,7 +124,6 @@ feature 'Protected Branches', :js do ...@@ -128,7 +124,6 @@ feature 'Protected Branches', :js do
project.repository.add_branch(admin, 'staging-stable', 'master') project.repository.add_branch(admin, 'staging-stable', 'master')
visit project_protected_branches_path(project) visit project_protected_branches_path(project)
set_defaults
set_protected_branch_name('*-stable') set_protected_branch_name('*-stable')
set_allowed_to('merge') set_allowed_to('merge')
set_allowed_to('push') set_allowed_to('push')
...@@ -149,7 +144,6 @@ feature 'Protected Branches', :js do ...@@ -149,7 +144,6 @@ feature 'Protected Branches', :js do
set_protected_branch_name('*-stable') set_protected_branch_name('*-stable')
set_allowed_to('merge') set_allowed_to('merge')
set_allowed_to('push') set_allowed_to('push')
set_defaults
click_on "Protect" click_on "Protect"
visit project_protected_branches_path(project) visit project_protected_branches_path(project)
...@@ -234,18 +228,4 @@ feature 'Protected Branches', :js do ...@@ -234,18 +228,4 @@ feature 'Protected Branches', :js do
find(".dropdown-input-field").set(branch_name) find(".dropdown-input-field").set(branch_name)
click_on("Create wildcard #{branch_name}") click_on("Create wildcard #{branch_name}")
end end
def set_defaults
find(".js-allowed-to-merge").click
within('.qa-allowed-to-merge-dropdown') do
expect(first("li")).to have_content("Roles")
find(:link, 'No one').click
end
find(".js-allowed-to-push").click
within('.qa-allowed-to-push-dropdown') do
expect(first("li")).to have_content("Roles")
find(:link, 'No one').click
end
end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment