Commit 3d052438 authored by Yorick Peterse's avatar Yorick Peterse

Make protected tags spec the same for CE and EE

This changes a protected tags feature spec so that it is the same in
both CE and EE. This requires the use of a `if Gitlab.ee?` check, as the
added lines don't work in CE but do work in EE. Removing them entirely
in turn breaks the EE spec.
parent 646521bd
...@@ -16,6 +16,7 @@ describe 'Protected Tags', :js do ...@@ -16,6 +16,7 @@ describe 'Protected Tags', :js do
it "allows creating explicit protected tags" do it "allows creating explicit protected tags" do
visit project_protected_tags_path(project) visit project_protected_tags_path(project)
set_protected_tag_name('some-tag') set_protected_tag_name('some-tag')
set_allowed_to('create') if Gitlab.ee?
click_on "Protect" click_on "Protect"
within(".protected-tags-list") { expect(page).to have_content('some-tag') } within(".protected-tags-list") { expect(page).to have_content('some-tag') }
...@@ -29,6 +30,7 @@ describe 'Protected Tags', :js do ...@@ -29,6 +30,7 @@ describe 'Protected Tags', :js do
visit project_protected_tags_path(project) visit project_protected_tags_path(project)
set_protected_tag_name('some-tag') set_protected_tag_name('some-tag')
set_allowed_to('create') if Gitlab.ee?
click_on "Protect" click_on "Protect"
within(".protected-tags-list") { expect(page).to have_content(commit.id[0..7]) } within(".protected-tags-list") { expect(page).to have_content(commit.id[0..7]) }
...@@ -37,6 +39,7 @@ describe 'Protected Tags', :js do ...@@ -37,6 +39,7 @@ describe 'Protected Tags', :js do
it "displays an error message if the named tag does not exist" do it "displays an error message if the named tag does not exist" do
visit project_protected_tags_path(project) visit project_protected_tags_path(project)
set_protected_tag_name('some-tag') set_protected_tag_name('some-tag')
set_allowed_to('create') if Gitlab.ee?
click_on "Protect" click_on "Protect"
within(".protected-tags-list") { expect(page).to have_content('tag was removed') } within(".protected-tags-list") { expect(page).to have_content('tag was removed') }
...@@ -47,6 +50,7 @@ describe 'Protected Tags', :js do ...@@ -47,6 +50,7 @@ describe 'Protected Tags', :js do
it "allows creating protected tags with a wildcard" do it "allows creating protected tags with a wildcard" do
visit project_protected_tags_path(project) visit project_protected_tags_path(project)
set_protected_tag_name('*-stable') set_protected_tag_name('*-stable')
set_allowed_to('create') if Gitlab.ee?
click_on "Protect" click_on "Protect"
within(".protected-tags-list") { expect(page).to have_content('*-stable') } within(".protected-tags-list") { expect(page).to have_content('*-stable') }
...@@ -60,6 +64,7 @@ describe 'Protected Tags', :js do ...@@ -60,6 +64,7 @@ describe 'Protected Tags', :js do
visit project_protected_tags_path(project) visit project_protected_tags_path(project)
set_protected_tag_name('*-stable') set_protected_tag_name('*-stable')
set_allowed_to('create') if Gitlab.ee?
click_on "Protect" click_on "Protect"
within(".protected-tags-list") do within(".protected-tags-list") do
...@@ -75,6 +80,7 @@ describe 'Protected Tags', :js do ...@@ -75,6 +80,7 @@ describe 'Protected Tags', :js do
visit project_protected_tags_path(project) visit project_protected_tags_path(project)
set_protected_tag_name('*-stable') set_protected_tag_name('*-stable')
set_allowed_to('create') if Gitlab.ee?
click_on "Protect" click_on "Protect"
visit project_protected_tags_path(project) visit project_protected_tags_path(project)
......
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