diff options
author | Robert Speicher <rspeicher@gmail.com> | 2015-04-30 00:47:55 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2015-05-06 19:58:28 +0300 |
commit | e167f28549b80141165f42b567073c5dd55f80c5 (patch) | |
tree | e91e3786c94ad9e489d5ece6bdd6d9f9fc0337d0 /spec/support/taskable_shared_examples.rb | |
parent | ce29e5cd8f09212afd3274326917c364272a6e39 (diff) |
Update Taskable to use TaskList
Diffstat (limited to 'spec/support/taskable_shared_examples.rb')
-rw-r--r-- | spec/support/taskable_shared_examples.rb | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/spec/support/taskable_shared_examples.rb b/spec/support/taskable_shared_examples.rb index 8e5e3a8aafc..77e0ed5f578 100644 --- a/spec/support/taskable_shared_examples.rb +++ b/spec/support/taskable_shared_examples.rb @@ -4,27 +4,13 @@ # subject { Issue or MergeRequest } shared_examples 'a Taskable' do before do - subject.description = <<EOT.gsub(/ {6}/, '') + subject.description = <<-EOT.strip_heredoc * [ ] Task 1 * [x] Task 2 * [x] Task 3 * [ ] Task 4 * [ ] Task 5 -EOT - end - - it 'updates the Nth task correctly' do - subject.update_nth_task(1, true) - expect(subject.description).to match(/\[x\] Task 1/) - - subject.update_nth_task(2, true) - expect(subject.description).to match('\[x\] Task 2') - - subject.update_nth_task(3, false) - expect(subject.description).to match('\[ \] Task 3') - - subject.update_nth_task(4, false) - expect(subject.description).to match('\[ \] Task 4') + EOT end it 'returns the correct task status' do @@ -33,10 +19,14 @@ EOT expect(subject.task_status).to match('3 unfinished') end - it 'knows if it has tasks' do - expect(subject.tasks?).to be_truthy + describe '#tasks?' do + it 'returns true when object has tasks' do + expect(subject.tasks?).to eq true + end - subject.description = 'Now I have no tasks' - expect(subject.tasks?).to be_falsey + it 'returns false when object has no tasks' do + subject.description = 'Now I have no tasks' + expect(subject.tasks?).to eq false + end end end |