Commit 09af9eec authored by Clement Ho's avatar Clement Ho

Add spec for tasklist

parent e9ea5785
......@@ -3,7 +3,16 @@ require 'spec_helper'
feature 'Update Epic', :js do
let(:user) { create(:user) }
let(:group) { create(:group, :public) }
let(:epic) { create(:epic, group: group) }
let(:markdown) do
<<-MARKDOWN.strip_heredoc
This is a task list:
- [ ] Incomplete entry 1
MARKDOWN
end
let(:epic) { create(:epic, group: group, description: markdown) }
before do
stub_licensed_features(epics: true)
......@@ -20,6 +29,7 @@ feature 'Update Epic', :js do
end
context 'when user with developer access displays the epic' do
before do
group.add_developer(user)
visit group_epic_path(group, epic)
......@@ -36,5 +46,15 @@ feature 'Update Epic', :js do
expect(find('.issuable-details h2.title')).to have_content('New epic title')
expect(find('.issuable-details .description')).to have_content('New epic description')
end
it 'updates the tasklist' do
expect(page).to have_selector('ul.task-list', count: 1)
expect(page).to have_selector('li.task-list-item', count: 1)
expect(page).to have_selector('ul input[checked]', count: 0)
find('.task-list .task-list-item', text: 'Incomplete entry 1').find('input').click
expect(page).to have_selector('ul input[checked]', count: 1)
end
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