diff options
author | Luke Bennett <lukeeeebennettplus@gmail.com> | 2018-05-29 12:11:14 +0100 |
---|---|---|
committer | Luke Bennett <lukeeeebennettplus@gmail.com> | 2018-05-29 12:11:14 +0100 |
commit | cd0be3ba456f5cf61ed72f1c6b36bef799d7eaaf (patch) | |
tree | 428026e32dbb25d4659523d5ba7307068d514b9b | |
parent | 3b3645136bd524a5e9f79558ab16be976cfe5282 (diff) | |
download | gitlab-ce-cd0be3ba456f5cf61ed72f1c6b36bef799d7eaaf.tar.gz |
Fix user_removes_labels_spec
-rw-r--r-- | app/views/shared/_label.html.haml | 3 | ||||
-rw-r--r-- | spec/features/projects/labels/user_removes_labels_spec.rb | 21 |
2 files changed, 12 insertions, 12 deletions
diff --git a/app/views/shared/_label.html.haml b/app/views/shared/_label.html.haml index c9ff5defdc7..391021a7665 100644 --- a/app/views/shared/_label.html.haml +++ b/app/views/shared/_label.html.haml @@ -43,7 +43,8 @@ toggle: 'modal' } } = _('Promote to group label') %li - = link_to _('Delete'), destroy_label_path(label), title: 'Delete', method: :delete, data: { confirm: _('Remove this label? Are you sure?') }, class: 'text-danger' + %span{ data: { toggle: 'modal', target: "#modal-delete-label-#{label.id}" } } + = button_tag 'Delete', type: 'button', class: 'text-danger remove-row' - if current_user %li.inline.label-subscription - if can_subscribe_to_label_in_different_levels?(label) diff --git a/spec/features/projects/labels/user_removes_labels_spec.rb b/spec/features/projects/labels/user_removes_labels_spec.rb index f4fda6de465..120c618b530 100644 --- a/spec/features/projects/labels/user_removes_labels_spec.rb +++ b/spec/features/projects/labels/user_removes_labels_spec.rb @@ -17,8 +17,9 @@ describe "User removes labels" do end it "removes label" do - page.within(".labels") do + page.within(".other-labels") do page.first(".label-list-item") do + first('.js-label-options-dropdown').click first(".remove-row").click first(:link, "Delete label").click end @@ -36,17 +37,15 @@ describe "User removes labels" do end it "removes all labels" do - page.within(".labels") do - loop do - li = page.first(".label-list-item") - break unless li - - li.click_link("Delete") - click_link("Delete label") - end - - expect(page).to have_content("Generate a default set of labels").and have_content("New label") + loop do + li = page.first(".label-list-item") + break unless li + li.find('.js-label-options-dropdown').click + li.click_button("Delete") + click_link("Delete label") end + + expect(page).to have_content("Generate a default set of labels").and have_content("New label") end end end |