summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-08-16 11:31:21 -0300
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-08-17 12:58:59 -0300
commitc6511235e4253d11447b40c2ea42ecb02c99687e (patch)
treeae7d2d39479ecde85682b55a68227df056ffa019 /spec
parent29a91c5bc65524fffeaaba493f30c419b98f0869 (diff)
downloadgitlab-ce-c6511235e4253d11447b40c2ea42ecb02c99687e.tar.gz
Add a destroyable scope and a destroyable? method to List model
Diffstat (limited to 'spec')
-rw-r--r--spec/models/list_spec.rb20
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