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-10-15 00:51:34 +0300
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-10-19 19:58:27 +0300
commit99e928f103182b58156edb107b55344eaafc6772 (patch)
tree744fdb8be884826e861090821675476d26a496fd /spec/models/project_label_spec.rb
parent67314e95ae836365fa1989439a6379aac781a0b4 (diff)
Add restriction to number of permitted priorities per project label
Diffstat (limited to 'spec/models/project_label_spec.rb')
-rw-r--r--spec/models/project_label_spec.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/spec/models/project_label_spec.rb b/spec/models/project_label_spec.rb
index c861d4b73bb..cd4732fb737 100644
--- a/spec/models/project_label_spec.rb
+++ b/spec/models/project_label_spec.rb
@@ -48,7 +48,18 @@ describe ProjectLabel, models: true do
project_label.valid?
- expect(project_label .errors[:title]).to be_empty
+ expect(project_label.errors[:title]).to be_empty
+ end
+ end
+
+ context 'when attempting to add more than one priority to the project label' do
+ it 'returns error' do
+ subject.priorities.build
+ subject.priorities.build
+
+ subject.valid?
+
+ expect(subject.errors[:priorities]).to include 'Number of permitted priorities exceeded'
end
end
end