Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-08-01 02:48:00 +0300
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-08-17 18:58:57 +0300
commit4b75c75018c9a3eac7a2c8b1772a10c98ea3bdc0 (patch)
tree141c6c6db67a03d44980b77b7a6f5e24d6ec628d /spec/models/list_spec.rb
parent252e93c9e664e595ea9b4987f14ca8fb21a0e307 (diff)
The lists: Backlog, and Done cannot be destroyed
Diffstat (limited to 'spec/models/list_spec.rb')
-rw-r--r--spec/models/list_spec.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/models/list_spec.rb b/spec/models/list_spec.rb
index 689011454d3..45c07a679cb 100644
--- a/spec/models/list_spec.rb
+++ b/spec/models/list_spec.rb
@@ -31,6 +31,27 @@ describe List do
it { is_expected.not_to validate_presence_of(:position) }
end
end
+
+ describe '#destroy' do
+ it 'can be destroyed when when list_type is set to label' do
+ subject = create(:label_list)
+
+ expect(subject.destroy).to be_truthy
+ end
+
+ it 'can not be destroyed when list_type is set to backlog' do
+ subject = create(:backlog_list)
+
+ expect(subject.destroy).to be_falsey
+ end
+
+ it 'can not be destroyed when when list_type is set to done' do
+ subject = create(:done_list)
+
+ expect(subject.destroy).to be_falsey
+ end
+ end
+
describe '#title' do
it 'returns label name when list_type is set to label' do
subject.list_type = :label