summaryrefslogtreecommitdiff
path: root/spec/support
diff options
context:
space:
mode:
authorJarka Kadlecova <jarka@gitlab.com>2017-01-18 08:33:13 -0500
committerJarka Kadlecova <jarka@gitlab.com>2017-01-24 15:08:16 +0100
commitf30ad3ff1f958ccb783f3fab68269e61f1a79b3d (patch)
treea536ce0434491d3dc9ea851220932bd146f04d60 /spec/support
parentcdf0af666c04290ece320e39a890af75f2e7d7e4 (diff)
downloadgitlab-ce-f30ad3ff1f958ccb783f3fab68269e61f1a79b3d.tar.gz
fix nested tasks in ordered list
Diffstat (limited to 'spec/support')
-rw-r--r--spec/support/taskable_shared_examples.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/support/taskable_shared_examples.rb b/spec/support/taskable_shared_examples.rb
index ad1c783df4d..1b6c33248c9 100644
--- a/spec/support/taskable_shared_examples.rb
+++ b/spec/support/taskable_shared_examples.rb
@@ -33,6 +33,30 @@ shared_examples 'a Taskable' do
end
end
+ describe 'with nested tasks' do
+ before do
+ subject.description = <<-EOT.strip_heredoc
+ - [ ] Task a
+ - [x] Task a.1
+ - [ ] Task a.2
+ - [ ] Task b
+
+ 1. [ ] Task 1
+ 1. [ ] Task 1.1
+ 1. [ ] Task 1.2
+ 1. [x] Task 2
+ 1. [x] Task 2.1
+ EOT
+ end
+
+ it 'returns the correct task status' do
+ expect(subject.task_status).to match('3 of')
+ expect(subject.task_status).to match('9 tasks completed')
+ expect(subject.task_status_short).to match('3/')
+ expect(subject.task_status_short).to match('9 tasks')
+ end
+ end
+
describe 'with an incomplete task' do
before do
subject.description = <<-EOT.strip_heredoc