diff --git a/app/models/add_member.rb b/app/models/add_member.rb index bd20dfb..2f1a2ba 100644 --- 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 diff --git a/test/unit/add_member_test.rb b/test/unit/add_member_test.rb index 249ebb5..8c0d51b 100644 --- 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 -- libgit2 0.21.2