diff options
author | Jarka Kadlecova <jarka@gitlab.com> | 2017-01-25 10:24:14 +0300 |
---|---|---|
committer | Jarka Kadlecova <jarka@gitlab.com> | 2017-01-25 22:54:11 +0300 |
commit | 816fad3530d3d9774733c4fa215d43b9b06a1f95 (patch) | |
tree | b702de1b7ac2120370710307280ec55d58ccc749 /spec | |
parent | 94715834cef03ab5e7bda0bb558a650f39d41e94 (diff) |
Don’t count tasks that are not defined as list items correctly
Diffstat (limited to 'spec')
-rw-r--r-- | spec/support/taskable_shared_examples.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/support/taskable_shared_examples.rb b/spec/support/taskable_shared_examples.rb index 1b6c33248c9..4056ff06b84 100644 --- a/spec/support/taskable_shared_examples.rb +++ b/spec/support/taskable_shared_examples.rb @@ -72,6 +72,25 @@ shared_examples 'a Taskable' do end end + describe 'with tasks that are not formatted correctly' do + before do + subject.description = <<-EOT.strip_heredoc + [ ] task 1 + [ ] task 2 + + - [ ]task 1 + -[ ] task 2 + EOT + end + + it 'returns the correct task status' do + expect(subject.task_status).to match('0 of') + expect(subject.task_status).to match('0 tasks completed') + expect(subject.task_status_short).to match('0/') + expect(subject.task_status_short).to match('0 task') + end + end + describe 'with a complete task' do before do subject.description = <<-EOT.strip_heredoc |