summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnnabel Dunstone Gray <annabel.dunstone@gmail.com>2018-01-29 08:37:56 -0700
committerAnnabel Dunstone Gray <annabel.dunstone@gmail.com>2018-01-30 13:26:35 -0700
commit659e6f32d3d8e25f473c8a7413e5c6a0d19e41f6 (patch)
treef10b33ed62f9a8a004088b1d7986535da36c5bbb
parent0ef1a582b625f7f6f52e377fc62dc526da34cfb6 (diff)
downloadgitlab-ce-659e6f32d3d8e25f473c8a7413e5c6a0d19e41f6.tar.gz
Fix labels specs
-rw-r--r--app/views/shared/_delete_label_modal.html.haml4
-rw-r--r--app/views/shared/_label.html.haml2
-rw-r--r--features/steps/project/issues/labels.rb5
-rw-r--r--spec/features/projects/labels/update_prioritization_spec.rb2
4 files changed, 7 insertions, 6 deletions
diff --git a/app/views/shared/_delete_label_modal.html.haml b/app/views/shared/_delete_label_modal.html.haml
index f29c8f00d52..01effefc34d 100644
--- a/app/views/shared/_delete_label_modal.html.haml
+++ b/app/views/shared/_delete_label_modal.html.haml
@@ -7,8 +7,8 @@
.modal-body
%p
- %strong #{label.name}
- will be permanently deleted from #{label.group.name}. This cannot be undone.
+ %strong= label.name
+ %span will be permanently deleted from #{label.is_a?(ProjectLabel)? label.project.name : label.group.name}. This cannot be undone.
.modal-footer
%a{ href: '#', data: { dismiss: 'modal' }, class: 'btn btn-default' } Cancel
diff --git a/app/views/shared/_label.html.haml b/app/views/shared/_label.html.haml
index dd9b4b4db44..9e140cd3f13 100644
--- a/app/views/shared/_label.html.haml
+++ b/app/views/shared/_label.html.haml
@@ -5,7 +5,7 @@
- show_label_merge_requests_link = show_label_issuables_link?(label, :merge_requests, project: @project)
- show_label_issues_link = show_label_issuables_link?(label, :issues, project: @project)
-%li{ id: label_css_id, data: { id: label.id } }
+%li.label-list-item{ id: label_css_id, data: { id: label.id } }
= render "shared/label_row", label: label
.visible-xs.visible-sm-inline-block.dropdown
diff --git a/features/steps/project/issues/labels.rb b/features/steps/project/issues/labels.rb
index 196e0fff63a..4df96e081f9 100644
--- a/features/steps/project/issues/labels.rb
+++ b/features/steps/project/issues/labels.rb
@@ -15,8 +15,9 @@ class Spinach::Features::ProjectIssuesLabels < Spinach::FeatureSteps
step 'I delete all labels' do
page.within '.labels' do
- page.all('.remove-row').each do
- accept_confirm { first('.remove-row').click }
+ page.all('.label-list-item').each do
+ first('.remove-row').click
+ first(:link, 'Delete label').click
end
end
end
diff --git a/spec/features/projects/labels/update_prioritization_spec.rb b/spec/features/projects/labels/update_prioritization_spec.rb
index 85bd776932b..ae8b1364ec7 100644
--- a/spec/features/projects/labels/update_prioritization_spec.rb
+++ b/spec/features/projects/labels/update_prioritization_spec.rb
@@ -99,7 +99,7 @@ feature 'Prioritize labels' do
expect(page).to have_content 'wontfix'
# Sort labels
- drag_to(selector: '.js-prioritized-labels', from_index: 1, to_index: 2)
+ drag_to(selector: '.label-list-item', from_index: 1, to_index: 2)
page.within('.prioritized-labels') do
expect(first('li')).to have_content('feature')