summaryrefslogtreecommitdiff
path: root/spec/models/label_spec.rb
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-09-20 00:17:04 -0300
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-10-19 14:58:24 -0200
commit9463551ece6c12574559a4768943ab90db7f617b (patch)
treea4fc438116b4cac6180df8ff8d8d974ad5d4d0c2 /spec/models/label_spec.rb
parentbdb7bf4b5188ffd68e54cbf671ba9ce1a4ffb1d1 (diff)
downloadgitlab-ce-9463551ece6c12574559a4768943ab90db7f617b.tar.gz
Validates uniqueness of title unless label is a template
Diffstat (limited to 'spec/models/label_spec.rb')
-rw-r--r--spec/models/label_spec.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/spec/models/label_spec.rb b/spec/models/label_spec.rb
index 5a5d1a5d60c..894021dc8e6 100644
--- a/spec/models/label_spec.rb
+++ b/spec/models/label_spec.rb
@@ -19,6 +19,7 @@ describe Label, models: true do
describe 'validation' do
it { is_expected.to validate_presence_of(:project) }
+ it { is_expected.to validate_uniqueness_of(:title) }
it 'validates color code' do
expect(label).not_to allow_value('G-ITLAB').for(:color)