diff --git a/app/models/user.rb b/app/models/user.rb index 12c50ccac..9577d4cd4 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -39,6 +39,7 @@ class User < ApplicationRecord length: { maximum: 50 }, email: true, allow_blank: true + validates :name, length: { maximum: 100 } validates :username, presence: true, uniqueness: { case_sensitive: false }, diff --git a/app/views/pages/bounty.html.erb b/app/views/pages/bounty.html.erb index b08d9e38c..b1e98e930 100644 --- a/app/views/pages/bounty.html.erb +++ b/app/views/pages/bounty.html.erb @@ -77,6 +77,7 @@ 'Aman Mahendra', 'Kaushik Roy', 'Shiv Bihari Pandey', + 'Sahil Mehra', ] %> <% hunters.shuffle.each do |hunter| %>
  • <%= hunter %>
  • diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 2c718b6ee..abcd94366 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -25,6 +25,7 @@ RSpec.describe User, type: :model do it { is_expected.to validate_uniqueness_of(:twitter_username).allow_blank } it { is_expected.to validate_presence_of(:username) } it { is_expected.to validate_length_of(:username).is_at_most(30).is_at_least(2) } + it { is_expected.to validate_length_of(:name).is_at_most(100) } # the followings are failing # it { is_expected.to have_many(:keys) }