diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-08-16 17:31:21 +0300 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-08-17 18:58:59 +0300 |
commit | c6511235e4253d11447b40c2ea42ecb02c99687e (patch) | |
tree | ae7d2d39479ecde85682b55a68227df056ffa019 /spec/models/list_spec.rb | |
parent | 29a91c5bc65524fffeaaba493f30c419b98f0869 (diff) |
Add a destroyable scope and a destroyable? method to List model
Diffstat (limited to 'spec/models/list_spec.rb')
-rw-r--r-- | spec/models/list_spec.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/models/list_spec.rb b/spec/models/list_spec.rb index 664d12a2fd3..d5c60f65043 100644 --- a/spec/models/list_spec.rb +++ b/spec/models/list_spec.rb @@ -54,6 +54,26 @@ describe List do end end + describe '#destroyable?' do + it 'retruns true when list_type is set to label' do + subject.list_type = :label + + expect(subject).to be_destroyable + end + + it 'retruns false when list_type is set to backlog' do + subject.list_type = :backlog + + expect(subject).not_to be_destroyable + end + + it 'retruns false when list_type is set to done' do + subject.list_type = :done + + expect(subject).not_to be_destroyable + end + end + describe '#title' do it 'returns label name when list_type is set to label' do subject.list_type = :label |