]> source.dussan.org Git - redmine.git/commitdiff
Merged r3873 from trunk.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 25 Jul 2010 09:52:07 +0000 (09:52 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 25 Jul 2010 09:52:07 +0000 (09:52 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/1.0-stable@3874 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/user.rb
test/unit/user_test.rb

index 8148ae3a9fb7abba4ac0199618b59acd86f335b7..db18db49e297acc9d3f44121507ea80b81022879 100644 (file)
@@ -79,6 +79,10 @@ class User < Principal
     super
   end
   
+  def mail=(arg)
+    write_attribute(:mail, arg.to_s.strip)
+  end
+  
   def identity_url=(url)
     if url.blank?
       write_attribute(:identity_url, '')
index 5a0c9f87e704531a04ac2af7bc0062fb00845d8f..ea40ccff61ab958b73f1864543de4e4393dab997 100644 (file)
@@ -35,6 +35,12 @@ class UserTest < ActiveSupport::TestCase
   def test_truth
     assert_kind_of User, @jsmith
   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
     user = User.new(:firstname => "new", :lastname => "user", :mail => "newuser@somenet.foo")