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-07-29 01:26:16 +0300
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-08-17 18:58:57 +0300
commitb07c5f23b8761ae87d29ded1a69b14ae6393443a (patch)
treeec6d9812ae818c282480ef930c971462a203560f /spec/models/list_spec.rb
parent35420cec0bf511af662e09cbd8664720c58fa187 (diff)
Order board lists by list_type, and position
Diffstat (limited to 'spec/models/list_spec.rb')
-rw-r--r--spec/models/list_spec.rb14
1 files changed, 8 insertions, 6 deletions
diff --git a/spec/models/list_spec.rb b/spec/models/list_spec.rb
index 7ad32047cb7..60b46f06195 100644
--- a/spec/models/list_spec.rb
+++ b/spec/models/list_spec.rb
@@ -13,16 +13,18 @@ describe List do
it { is_expected.to validate_presence_of(:position) }
it { is_expected.to validate_numericality_of(:position).only_integer.is_greater_than_or_equal_to(0) }
- it 'does not require label to be set when list_type is set to backlog' do
- subject.list_type = :backlog
+ context 'when list_type is set to backlog' do
+ subject { described_class.new(list_type: :backlog) }
- expect(subject).not_to validate_presence_of(:label)
+ it { is_expected.not_to validate_presence_of(:label) }
+ it { is_expected.not_to validate_presence_of(:position) }
end
- it 'does not require label to be set when list_type is set to done' do
- subject.list_type = :done
+ context 'when list_type is set to done' do
+ subject { described_class.new(list_type: :done) }
- expect(subject).not_to validate_presence_of(:label)
+ it { is_expected.not_to validate_presence_of(:label) }
+ it { is_expected.not_to validate_presence_of(:position) }
end
end
end