summaryrefslogtreecommitdiff
path: root/spec/features/issues
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2016-06-07 10:18:57 +0100
committerPhil Hughes <me@iamphill.com>2016-06-14 08:36:07 +0100
commita1be3241ec1f91182435a10615beac15fcfe235a (patch)
tree08e7b05320ac8a0e7fe9bc79fd390e4fb7d745bc /spec/features/issues
parent05525b5531f570e144341faad7428a6099a82710 (diff)
downloadgitlab-ce-a1be3241ec1f91182435a10615beac15fcfe235a.tar.gz
Todo tests and CHANGELOG
Diffstat (limited to 'spec/features/issues')
-rw-r--r--spec/features/issues/todo_spec.rb33
1 files changed, 33 insertions, 0 deletions
diff --git a/spec/features/issues/todo_spec.rb b/spec/features/issues/todo_spec.rb
new file mode 100644
index 00000000000..b69cce3e7d7
--- /dev/null
+++ b/spec/features/issues/todo_spec.rb
@@ -0,0 +1,33 @@
+require 'rails_helper'
+
+feature 'Manually create a todo item from issue', feature: true, js: true do
+ let!(:project) { create(:project) }
+ let!(:issue) { create(:issue, project: project) }
+ let!(:user) { create(:user)}
+
+ before do
+ project.team << [user, :master]
+ login_as(user)
+ visit namespace_project_issue_path(project.namespace, project, issue)
+ end
+
+ it 'should create todo when clicking button' do
+ page.within '.issuable-sidebar' do
+ click_button 'Add Todo'
+ expect(page).to have_content 'Mark Done'
+ end
+
+ page.within '.header-content .todos-pending-count' do
+ expect(page).to have_content '1'
+ end
+ end
+
+ it 'should mark a todo as done' do
+ page.within '.issuable-sidebar' do
+ click_button 'Add Todo'
+ click_button 'Mark Done'
+ end
+
+ expect(page).to have_selector('.todos-pending-count', visible: false)
+ end
+end