debian-mirror-gitlab/spec/features/issues/todo_spec.rb

44 lines
1.1 KiB
Ruby
Raw Normal View History

require 'rails_helper'
2018-03-17 18:26:18 +05:30
feature 'Manually create a todo item from issue', :js do
2017-09-10 17:25:29 +05:30
let!(:project) { create(:project) }
let!(:issue) { create(:issue, project: project) }
let!(:user) { create(:user)}
before do
2018-03-17 18:26:18 +05:30
project.add_master(user)
2017-09-10 17:25:29 +05:30
sign_in(user)
visit project_issue_path(project, issue)
end
2016-09-13 17:45:13 +05:30
it 'creates todo when clicking button' do
page.within '.issuable-sidebar' do
2017-08-17 22:00:37 +05:30
click_button 'Add todo'
2018-10-15 14:42:47 +05:30
expect(page).to have_content 'Mark todo as done'
end
2017-08-17 22:00:37 +05:30
page.within '.header-content .todos-count' do
expect(page).to have_content '1'
end
2016-06-22 15:30:34 +05:30
2017-09-10 17:25:29 +05:30
visit project_issue_path(project, issue)
2016-06-22 15:30:34 +05:30
2017-08-17 22:00:37 +05:30
page.within '.header-content .todos-count' do
2016-06-22 15:30:34 +05:30
expect(page).to have_content '1'
end
end
2016-09-13 17:45:13 +05:30
it 'marks a todo as done' do
page.within '.issuable-sidebar' do
2017-08-17 22:00:37 +05:30
click_button 'Add todo'
2018-10-15 14:42:47 +05:30
click_button 'Mark todo as done'
end
2017-08-17 22:00:37 +05:30
expect(page).to have_selector('.todos-count', visible: false)
2016-06-22 15:30:34 +05:30
2017-09-10 17:25:29 +05:30
visit project_issue_path(project, issue)
2016-06-22 15:30:34 +05:30
2017-08-17 22:00:37 +05:30
expect(page).to have_selector('.todos-count', visible: false)
end
end