diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2019-02-14 15:24:02 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2019-02-14 18:09:11 +0300 |
commit | f7bd3bdbf3bbb991853f8a47b1ebaee8fc5ce03b (patch) | |
tree | 8393d74b65d7529e55000f80b6f727d5443efe62 /spec/features/groups/labels | |
parent | ed7144ad58c32936c902d93da23eeb2159ee0158 (diff) |
Add more feature specs for group labels
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'spec/features/groups/labels')
-rw-r--r-- | spec/features/groups/labels/create_spec.rb | 23 | ||||
-rw-r--r-- | spec/features/groups/labels/index_spec.rb | 14 |
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 |