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:
authorAndreas Brandl <abrandl@gitlab.com>2019-04-05 14:29:19 +0300
committerAndreas Brandl <abrandl@gitlab.com>2019-04-05 14:29:19 +0300
commit30fa3cbdb74df2dfeebb2929a10dd301a0dde55e (patch)
tree72b5a7d8d615475ea2b8afabbfcebe1402c96d52 /spec/models
parent14cf8bf050896d617761e7947f81c8e23364a48b (diff)
parentebfe19e8e7690598f86facc0bb18df4052468fc0 (diff)
Merge branch '57493-add-limit-to-user-name' into 'master'
Add a length limit of 128 char to the user name field See merge request gitlab-org/gitlab-ce!26146
Diffstat (limited to 'spec/models')
-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)