summaryrefslogtreecommitdiff
path: root/spec/models/user_spec.rb
diff options
context:
space:
mode:
authorBrandon Labuschagne <blabuschagne@gitlab.com>2019-03-14 12:32:07 +0200
committerBrandon Labuschagne <blabuschagne@gitlab.com>2019-04-05 09:35:34 +0200
commitebfe19e8e7690598f86facc0bb18df4052468fc0 (patch)
tree895c9eff8dec2e7d2a93672d15a148503a6b5d4e /spec/models/user_spec.rb
parentb54228ad3d79dc0bd7060128e0b75f68cd1c51d9 (diff)
downloadgitlab-ce-ebfe19e8e7690598f86facc0bb18df4052468fc0.tar.gz
Add limit of 128 characters to users name57493-add-limit-to-user-name
Truncate existing users names which exceed 128 characters Include test for truncating users names
Diffstat (limited to 'spec/models/user_spec.rb')
-rw-r--r--spec/models/user_spec.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb
index b7e36748fa2..a45a2737b13 100644
--- a/spec/models/user_spec.rb
+++ b/spec/models/user_spec.rb
@@ -98,6 +98,11 @@ describe User do
end
describe 'validations' do
+ describe 'name' do
+ it { is_expected.to validate_presence_of(:name) }
+ it { is_expected.to validate_length_of(:name).is_at_most(128) }
+ end
+
describe 'username' do
it 'validates presence' do
expect(subject).to validate_presence_of(:username)