Commit f7bd3bdb authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Add more feature specs for group labels

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent ed7144ad
# 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
# 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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment