Strips user email (#5834).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3873 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
fd0623bf69
commit
66820dbed3
|
@ -79,6 +79,10 @@ class User < Principal
|
||||||
super
|
super
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def mail=(arg)
|
||||||
|
write_attribute(:mail, arg.to_s.strip)
|
||||||
|
end
|
||||||
|
|
||||||
def identity_url=(url)
|
def identity_url=(url)
|
||||||
if url.blank?
|
if url.blank?
|
||||||
write_attribute(:identity_url, '')
|
write_attribute(:identity_url, '')
|
||||||
|
|
|
@ -35,6 +35,12 @@ class UserTest < ActiveSupport::TestCase
|
||||||
def test_truth
|
def test_truth
|
||||||
assert_kind_of User, @jsmith
|
assert_kind_of User, @jsmith
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_mail_should_be_stripped
|
||||||
|
u = User.new
|
||||||
|
u.mail = " foo@bar.com "
|
||||||
|
assert_equal "foo@bar.com", u.mail
|
||||||
|
end
|
||||||
|
|
||||||
def test_create
|
def test_create
|
||||||
user = User.new(:firstname => "new", :lastname => "user", :mail => "newuser@somenet.foo")
|
user = User.new(:firstname => "new", :lastname => "user", :mail => "newuser@somenet.foo")
|
||||||
|
|
Loading…
Reference in New Issue