[Git][noosfero/noosfero][master] 2 commits: Better phrase for new member request

Bráulio Bhavamitra gitlab at gitlab.com
Mon Aug 10 17:39:14 BRT 2015


Bráulio Bhavamitra pushed to branch master at Noosfero / noosfero


Commits:
dbd7cf09 by dtygel at 2015-08-10T17:36:31Z
Better phrase for new member request

- - - - -
815c8f6a by Braulio Bhavamitra at 2015-08-10T17:38:36Z
Merge branch 'better-phrase-on-add-member' into noosfero

- - - - -


2 changed files:

- app/models/add_member.rb
- test/unit/add_member_test.rb


Changes:

=====================================
app/models/add_member.rb
=====================================
--- a/app/models/add_member.rb
+++ b/app/models/add_member.rb
@@ -26,7 +26,8 @@ class AddMember < Task
   end
 
   def information
-    {:message => _('%{requestor} wants to be a member of this community.')}
+    {:message => _("%{requestor} wants to be a member of '%{organization}'."),
+     variables: {requestor: requestor.name, organization: organization.name}}
   end
 
   def accept_details
@@ -42,7 +43,7 @@ class AddMember < Task
   end
 
   def target_notification_description
-    _('%{requestor} wants to be a member of this community.') % {:requestor => requestor.name}
+    _("%{requestor} wants to be a member of '%{organization}'.") % {:requestor => requestor.name, :organization => organization.name}
   end
 
   def target_notification_message


=====================================
test/unit/add_member_test.rb
=====================================
--- a/test/unit/add_member_test.rb
+++ b/test/unit/add_member_test.rb
@@ -105,20 +105,20 @@ class AddMemberTest < ActiveSupport::TestCase
   should 'have target notification message' do
     task = AddMember.new(:person => person, :organization => community)
 
-    assert_match(/#{person.name} wants to be a member of this community.*[\n]*.*to accept or reject/, task.target_notification_message)
+    assert_match(/#{person.name} wants to be a member of '#{community.name}'.*[\n]*.*to accept or reject/, task.target_notification_message)
   end
 
   should 'have target notification description' do
     task = AddMember.new(:person => person, :organization => community)
 
-    assert_match(/#{task.requestor.name} wants to be a member of this community/, task.target_notification_description)
+    assert_match(/#{task.requestor.name} wants to be a member of '#{community.name}'/, task.target_notification_description)
   end
 
   should 'deliver target notification message' do
     task = AddMember.new(:person => person, :organization => community)
 
     email = TaskMailer.target_notification(task, task.target_notification_message).deliver
-    assert_match(/#{task.requestor.name} wants to be a member of this community/, email.subject)
+    assert_match(/#{task.requestor.name} wants to be a member of '#{community.name}'/, email.subject)
   end
 
 end



View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/6573492abf02c36843d8eb23a8e1da2e05777471...815c8f6a04c1ee64180ee98ca3144da838dbe994
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20150810/475028dc/attachment.html>


More information about the Noosfero-dev mailing list