summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2019-02-14 15:52:53 +0000
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2019-02-14 15:52:53 +0000
commit750e3c670494cacec13f8b8d25951d8f57b67c1e (patch)
tree668bc559f0869ddc12c1d81e0f0c344b5b660879
parent1fc89ca9452c814d73245ec205d8e846d8760439 (diff)
parentf7bd3bdbf3bbb991853f8a47b1ebaee8fc5ce03b (diff)
downloadgitlab-ce-750e3c670494cacec13f8b8d25951d8f57b67c1e.tar.gz
Merge branch 'dz-grou-labels-specs' into 'master'
Add more feature specs for group labels Closes #25381 See merge request gitlab-org/gitlab-ce!25244
-rw-r--r--spec/features/groups/labels/create_spec.rb23
-rw-r--r--spec/features/groups/labels/index_spec.rb14
2 files changed, 36 insertions, 1 deletions
diff --git a/spec/features/groups/labels/create_spec.rb b/spec/features/groups/labels/create_spec.rb
new file mode 100644
index 00000000000..f5062a65321
--- /dev/null
+++ b/spec/features/groups/labels/create_spec.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+describe 'Create a group label' do
+ let(:user) { create(:user) }
+ let(:group) { create(:group) }
+
+ before do
+ group.add_owner(user)
+ sign_in(user)
+ visit group_labels_path(group)
+ end
+
+ it 'creates a new label' do
+ click_link 'New label'
+ fill_in 'Title', with: 'test-label'
+ click_button 'Create label'
+
+ expect(page).to have_content 'test-label'
+ expect(current_path).to eq(group_labels_path(group))
+ end
+end
diff --git a/spec/features/groups/labels/index_spec.rb b/spec/features/groups/labels/index_spec.rb
index 0ce7dad4040..62308d3b518 100644
--- a/spec/features/groups/labels/index_spec.rb
+++ b/spec/features/groups/labels/index_spec.rb
@@ -1,9 +1,12 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe 'Group labels' do
let(:user) { create(:user) }
let(:group) { create(:group) }
let!(:label) { create(:group_label, group: group) }
+ let!(:label2) { create(:group_label) }
before do
group.add_owner(user)
@@ -11,7 +14,16 @@ describe 'Group labels' do
visit group_labels_path(group)
end
- it 'label has edit button', :js do
+ it 'shows labels that belong to the group' do
+ expect(page).to have_content(label.name)
+ expect(page).not_to have_content(label2.name)
+ end
+
+ it 'shows a new label button' do
+ expect(page).to have_link('New label')
+ end
+
+ it 'shows an edit label button', :js do
expect(page).to have_selector('.label-action.edit')
end
end