@@ -79,6 +79,10 class User < Principal | |||
|
79 | 79 | super |
|
80 | 80 | end |
|
81 | 81 | |
|
82 | def mail=(arg) | |
|
83 | write_attribute(:mail, arg.to_s.strip) | |
|
84 | end | |
|
85 | ||
|
82 | 86 | def identity_url=(url) |
|
83 | 87 | if url.blank? |
|
84 | 88 | write_attribute(:identity_url, '') |
@@ -35,6 +35,12 class UserTest < ActiveSupport::TestCase | |||
|
35 | 35 | def test_truth |
|
36 | 36 | assert_kind_of User, @jsmith |
|
37 | 37 | end |
|
38 | ||
|
39 | def test_mail_should_be_stripped | |
|
40 | u = User.new | |
|
41 | u.mail = " foo@bar.com " | |
|
42 | assert_equal "foo@bar.com", u.mail | |
|
43 | end | |
|
38 | 44 | |
|
39 | 45 | def test_create |
|
40 | 46 | user = User.new(:firstname => "new", :lastname => "user", :mail => "newuser@somenet.foo") |
General Comments 0
You need to be logged in to leave comments.
Login now