Commit cd0be3ba authored by Luke Bennett's avatar Luke Bennett

Fix user_removes_labels_spec

parent 3b364513
...@@ -43,7 +43,8 @@ ...@@ -43,7 +43,8 @@
toggle: 'modal' } } toggle: 'modal' } }
= _('Promote to group label') = _('Promote to group label')
%li %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 - if current_user
%li.inline.label-subscription %li.inline.label-subscription
- if can_subscribe_to_label_in_different_levels?(label) - if can_subscribe_to_label_in_different_levels?(label)
......
...@@ -17,8 +17,9 @@ describe "User removes labels" do ...@@ -17,8 +17,9 @@ describe "User removes labels" do
end end
it "removes label" do it "removes label" do
page.within(".labels") do page.within(".other-labels") do
page.first(".label-list-item") do page.first(".label-list-item") do
first('.js-label-options-dropdown').click
first(".remove-row").click first(".remove-row").click
first(:link, "Delete label").click first(:link, "Delete label").click
end end
...@@ -36,17 +37,15 @@ describe "User removes labels" do ...@@ -36,17 +37,15 @@ describe "User removes labels" do
end end
it "removes all labels" do it "removes all labels" do
page.within(".labels") do
loop do loop do
li = page.first(".label-list-item") li = page.first(".label-list-item")
break unless li break unless li
li.find('.js-label-options-dropdown').click
li.click_link("Delete") li.click_button("Delete")
click_link("Delete label") click_link("Delete label")
end end
expect(page).to have_content("Generate a default set of labels").and have_content("New label") expect(page).to have_content("Generate a default set of labels").and have_content("New label")
end end
end 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