Skip to content

Commit

Permalink
login max length same as email max length
Browse files Browse the repository at this point in the history
  • Loading branch information
pld committed Jul 11, 2009
1 parent 7c5ec58 commit feae573
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/models/user.rb
Expand Up @@ -12,7 +12,7 @@ class User < ActiveRecord::Base
has_many :voters, :dependent => :destroy
has_many :prompts, :through => :questions, :dependent => :destroy

validates_length_of :login, :within => 3..40
validates_length_of :login, :within => 3..100
validates_uniqueness_of :login
validates_format_of :login, :with => Authentication.login_regex, :message => Authentication.bad_login_message

Expand Down
2 changes: 1 addition & 1 deletion spec/models/user_spec.rb
Expand Up @@ -57,7 +57,7 @@
end
end
describe 'disallows illegitimate logins:' do
['12', '1234567890_234567890_234567890_234567890_', "tab\t", "newline\n",
['12', '1234567890_234567890_234567890_234567890_1234567890_234567890_234567890_2345678901234567890_234567890_234567890_234567890_1234567890_234567890_234567890_234567890', "tab\t", "newline\n",
"Iñtërnâtiônàlizætiøn hasn't happened to ruby 1.8 yet",
'semicolon;', 'quote"', 'tick\'', 'backtick`', 'percent%', 'plus+', 'space '].each do |login_str|
it "'#{login_str}'" do
Expand Down

0 comments on commit feae573

Please sign in to comment.