diff options
Diffstat (limited to 'spec/features/protected_tags_spec.rb')
-rw-r--r-- | spec/features/protected_tags_spec.rb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/spec/features/protected_tags_spec.rb b/spec/features/protected_tags_spec.rb index 45315f53fd6..f5b463d63fa 100644 --- a/spec/features/protected_tags_spec.rb +++ b/spec/features/protected_tags_spec.rb @@ -15,6 +15,8 @@ RSpec.describe 'Protected Tags', :js, :with_license, feature_category: :source_c describe "explicit protected tags" do it "allows creating explicit protected tags" do visit project_protected_tags_path(project) + click_button('Add tag') + set_protected_tag_name('some-tag') set_allowed_to('create') click_on_protect @@ -29,6 +31,7 @@ RSpec.describe 'Protected Tags', :js, :with_license, feature_category: :source_c project.repository.add_tag(user, 'some-tag', commit.id) visit project_protected_tags_path(project) + click_button('Add tag') set_protected_tag_name('some-tag') set_allowed_to('create') click_on_protect @@ -38,6 +41,7 @@ RSpec.describe 'Protected Tags', :js, :with_license, feature_category: :source_c it "displays an error message if the named tag does not exist" do visit project_protected_tags_path(project) + click_button('Add tag') set_protected_tag_name('some-tag') set_allowed_to('create') click_on_protect @@ -49,6 +53,7 @@ RSpec.describe 'Protected Tags', :js, :with_license, feature_category: :source_c describe "wildcard protected tags" do it "allows creating protected tags with a wildcard" do visit project_protected_tags_path(project) + click_button('Add tag') set_protected_tag_name('*-stable') set_allowed_to('create') click_on_protect @@ -63,12 +68,16 @@ RSpec.describe 'Protected Tags', :js, :with_license, feature_category: :source_c project.repository.add_tag(user, 'staging-stable', 'master') visit project_protected_tags_path(project) + click_button('Add tag') set_protected_tag_name('*-stable') set_allowed_to('create') click_on_protect + within("#js-protected-tags-settings .gl-new-card-count") do + expect(page).to have_content("2") + end + within(".protected-tags-list") do - expect(page).to have_content("Protected tags (2)") expect(page).to have_content("2 matching tags") end end @@ -79,11 +88,13 @@ RSpec.describe 'Protected Tags', :js, :with_license, feature_category: :source_c project.repository.add_tag(user, 'development', 'master') visit project_protected_tags_path(project) + click_button('Add tag') set_protected_tag_name('*-stable') set_allowed_to('create') click_on_protect visit project_protected_tags_path(project) + click_button('Add tag') click_on "2 matching tags" within(".protected-tags-list") do |