diff options
Diffstat (limited to 'spec/support/shared_examples/taskable_shared_examples.rb')
-rw-r--r-- | spec/support/shared_examples/taskable_shared_examples.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/support/shared_examples/taskable_shared_examples.rb b/spec/support/shared_examples/taskable_shared_examples.rb index 4056ff06b84..f04f509f3d2 100644 --- a/spec/support/shared_examples/taskable_shared_examples.rb +++ b/spec/support/shared_examples/taskable_shared_examples.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Specs for task state functionality for issues and merge requests. # # Requires a context containing: @@ -105,4 +107,25 @@ shared_examples 'a Taskable' do expect(subject.task_status_short).to match('1 task') end end + + describe 'with tasks in blockquotes' do + before do + subject.description = <<-EOT.strip_heredoc + > - [ ] Task a + > > - [x] Task a.1 + + >>> + 1. [ ] Task 1 + 1. [x] Task 2 + >>> + EOT + end + + it 'returns the correct task status' do + expect(subject.task_status).to match('2 of') + expect(subject.task_status).to match('4 tasks completed') + expect(subject.task_status_short).to match('2/') + expect(subject.task_status_short).to match('4 tasks') + end + end end |