Fix user_removes_labels_spec
This commit is contained in:
parent
3b3645136b
commit
cd0be3ba45
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue