Commit 8b9f29ca8463c78634aabc3649f48f3b86f32410
Committed by
Thiago Ribeiro
1 parent
ced4464b
Exists in
stable-spb-1.4
and in
8 other branches
Fix and add tests for show requestor email on AddMember task
Showing
1 changed file
with
11 additions
and
2 deletions
Show diff stats
test/unit/add_member_test.rb
... | ... | @@ -121,12 +121,21 @@ class AddMemberTest < ActiveSupport::TestCase |
121 | 121 | assert_match(/#{task.requestor.name} wants to be a member of '#{community.name}'/, email.subject) |
122 | 122 | end |
123 | 123 | |
124 | - should 'have target notification description with requestor email' do | |
124 | + should 'notification description with requestor email if requestor email is public' do | |
125 | 125 | new_person = create_user('testuser').person |
126 | 126 | new_person.update_attributes!({:fields_privacy => {:email => 'public'}}) |
127 | 127 | |
128 | 128 | task = AddMember.new(:person => new_person, :organization => community) |
129 | 129 | |
130 | - assert_match(/#{task.requestor.name} \(#{task.requestor.email}\) wants to be a member of '#{community.name}'./, task.target_notification_description) | |
130 | + assert_match(/\(#{task.requestor.email}\)/, task.target_notification_description) | |
131 | + end | |
132 | + | |
133 | + should 'notification description without requestor email if requestor email is not public' do | |
134 | + new_person = create_user('testuser').person | |
135 | + new_person.update_attributes!({:fields_privacy => {:email => '0'}}) | |
136 | + | |
137 | + task = AddMember.new(:person => new_person, :organization => community) | |
138 | + | |
139 | + assert_not_match(/\(#{task.requestor.email}\)/, task.target_notification_description) | |
131 | 140 | end |
132 | 141 | end | ... | ... |