Commit 87eec62e185dd38c2949243f61300226816f8c56
1 parent
074a66ad
Exists in
master
and in
29 other branches
ActionItem96: every person needs an e-mail address
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@615 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
2 changed files
with
15 additions
and
0 deletions
Show diff stats
app/models/person.rb
test/unit/person_test.rb
... | ... | @@ -86,4 +86,15 @@ class PersonTest < Test::Unit::TestCase |
86 | 86 | assert p.has_permission?('edit_profile', e) |
87 | 87 | assert !p.has_permission?('destroy_profile', e) |
88 | 88 | end |
89 | + | |
90 | + should 'get an email address from the associated user instance' do | |
91 | + p = User.create!(:login => 'jonh', :email => 'john@doe.org', :password => 'dhoe', :password_confirmation => 'dhoe').person | |
92 | + assert_equal 'john@doe.org', p.email | |
93 | + end | |
94 | + | |
95 | + should 'get no email address when there is no associated user' do | |
96 | + p = Person.new | |
97 | + assert_nil p.email | |
98 | + end | |
99 | + | |
89 | 100 | end | ... | ... |