summaryrefslogtreecommitdiff
path: root/spec/features
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2018-07-20 19:05:36 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2018-07-31 12:46:36 +0300
commit85a8c7efb0666deb31255122933f958b5a81f6b5 (patch)
tree3e8d5681f301c688c98c3abd2f56d22ca030da8a /spec/features
parent692d4795d173319a18184e80113256696ad3d6f8 (diff)
downloadgitlab-ce-85a8c7efb0666deb31255122933f958b5a81f6b5.tar.gz
Add feature specs for project labels search
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'spec/features')
-rw-r--r--spec/features/projects/labels/search_labels_spec.rb37
1 files changed, 37 insertions, 0 deletions
diff --git a/spec/features/projects/labels/search_labels_spec.rb b/spec/features/projects/labels/search_labels_spec.rb
new file mode 100644
index 00000000000..dc15729190d
--- /dev/null
+++ b/spec/features/projects/labels/search_labels_spec.rb
@@ -0,0 +1,37 @@
+require 'spec_helper'
+
+describe 'Search for labels', :js do
+ let(:user) { create(:user) }
+ let(:project) { create(:project) }
+ let!(:label1) { create(:label, title: 'Foo', description: 'Lorem ipsum', project: project) }
+ let!(:label2) { create(:label, title: 'Bar', description: 'Fusce consequat', project: project) }
+
+ before do
+ project.add_maintainer(user)
+ sign_in(user)
+ end
+
+ it 'searches for label by title' do
+ visit project_labels_path(project)
+
+ fill_in 'label-search', with: 'Bar'
+ find('#label-search').native.send_keys(:enter)
+
+ expect(page).to have_content(label2.title)
+ expect(page).to have_content(label2.description)
+ expect(page).not_to have_content(label1.title)
+ expect(page).not_to have_content(label1.description)
+ end
+
+ it 'searches for label by title' do
+ visit project_labels_path(project)
+
+ fill_in 'label-search', with: 'Lorem'
+ find('#label-search').native.send_keys(:enter)
+
+ expect(page).to have_content(label1.title)
+ expect(page).to have_content(label1.description)
+ expect(page).not_to have_content(label2.title)
+ expect(page).not_to have_content(label2.description)
+ end
+end