diff options
Diffstat (limited to 'spec/features/projects/labels')
-rw-r--r-- | spec/features/projects/labels/sort_labels_spec.rb | 2 | ||||
-rw-r--r-- | spec/features/projects/labels/user_edits_labels_spec.rb | 14 |
2 files changed, 15 insertions, 1 deletions
diff --git a/spec/features/projects/labels/sort_labels_spec.rb b/spec/features/projects/labels/sort_labels_spec.rb index 83559b816d2..26b3d08253c 100644 --- a/spec/features/projects/labels/sort_labels_spec.rb +++ b/spec/features/projects/labels/sort_labels_spec.rb @@ -34,7 +34,7 @@ RSpec.describe 'Sort labels', :js do expect(sort_options[1]).to eq('Name, descending') expect(sort_options[2]).to eq('Last created') expect(sort_options[3]).to eq('Oldest created') - expect(sort_options[4]).to eq('Last updated') + expect(sort_options[4]).to eq('Updated date') expect(sort_options[5]).to eq('Oldest updated') click_link 'Name, descending' diff --git a/spec/features/projects/labels/user_edits_labels_spec.rb b/spec/features/projects/labels/user_edits_labels_spec.rb index 8300a1a8542..999c238c7b3 100644 --- a/spec/features/projects/labels/user_edits_labels_spec.rb +++ b/spec/features/projects/labels/user_edits_labels_spec.rb @@ -3,6 +3,8 @@ require "spec_helper" RSpec.describe "User edits labels" do + include Spec::Support::Helpers::ModalHelpers + let_it_be(:project) { create(:project_empty_repo, :public) } let_it_be(:label) { create(:label, project: project) } let_it_be(:user) { create(:user) } @@ -24,4 +26,16 @@ RSpec.describe "User edits labels" do expect(page).to have_content(new_title).and have_no_content(label.title) end end + + it 'allows user to delete label', :js do + click_button 'Delete' + + within_modal do + expect(page).to have_content("#{label.title} will be permanently deleted from #{project.name}. This cannot be undone.") + + click_link 'Delete label' + end + + expect(page).to have_content('Label was removed') + end end |