diff --git a/app/views/contact/sender/mail.rhtml b/app/views/contact/sender/mail.rhtml
index ecacb82..a30479b 100644
--- a/app/views/contact/sender/mail.rhtml
+++ b/app/views/contact/sender/mail.rhtml
@@ -5,10 +5,12 @@
<% end %>
<%= _('Message:') %>
---
+-------------------------------------------------------------------------------
+<%= word_wrap(@message) %>
+-------------------------------------------------------------------------------
-<%= @message %>
+<%= _('Greetings,') %>
--
-<%= _('%s environment system') % @environment %>
+<%= _('%s team.') % @environment %>
<%= @url %>
diff --git a/app/views/pending_task_notifier/notification.rhtml b/app/views/pending_task_notifier/notification.rhtml
index 0dedd8e..c649b4a 100644
--- a/app/views/pending_task_notifier/notification.rhtml
+++ b/app/views/pending_task_notifier/notification.rhtml
@@ -17,6 +17,9 @@
<%= url_for(:host => @default_hostname, :controller => 'tasks', :profile => organization.identifier) %>
<% end %>
+
+<%= _('Greetings,') %>
+
--
-<%= _('%s environment system') % @environment %>
+<%= _('%s team.') % @environment %>
<%= @url %>
diff --git a/app/views/task_mailer/task_cancelled.text.plain.rhtml b/app/views/task_mailer/task_cancelled.text.plain.rhtml
index e4a52c8..9f74c43 100644
--- a/app/views/task_mailer/task_cancelled.text.plain.rhtml
+++ b/app/views/task_mailer/task_cancelled.text.plain.rhtml
@@ -1,7 +1,9 @@
<%= _('Dear %s,') % @requestor %>
-<%= @message %>
+<%= word_wrap(@message) %>
+
+<%= _('Greetings,') %>
--
-<%= _('%s environment system') % @environment %>
+<%= _('%s team.') % @environment %>
<%= @url %>
diff --git a/app/views/user/mailer/activation_email_notify.rhtml b/app/views/user/mailer/activation_email_notify.rhtml
index 4fd7b2b..07a60aa 100644
--- a/app/views/user/mailer/activation_email_notify.rhtml
+++ b/app/views/user/mailer/activation_email_notify.rhtml
@@ -5,6 +5,8 @@
<%= _('You can access your e-mail from anywhere, using the following address:') %>
<%= @webmail %>
+<%= _('Greetings,') %>
+
--
-<%= _('%s environment system') % @environment %>
+<%= _('%s team.') % @environment %>
<%= @url %>
diff --git a/test/factories.rb b/test/factories.rb
index 34679c7..87f56d0 100644
--- a/test/factories.rb
+++ b/test/factories.rb
@@ -338,4 +338,12 @@ module Noosfero::Factory
{ }
end
+ ###############################################
+ # Contact
+ ###############################################
+
+ def defaults_for_contact
+ { :subject => 'hello there', :message => 'here I come to SPAM you' }
+ end
+
end
diff --git a/test/unit/contact_sender_test.rb b/test/unit/contact_sender_test.rb
index ff1a711..7b2dd64 100644
--- a/test/unit/contact_sender_test.rb
+++ b/test/unit/contact_sender_test.rb
@@ -14,7 +14,7 @@ class ContactSenderTest < Test::Unit::TestCase
should 'be able to deliver mail' do
ent = Enterprise.new(:name => 'my enterprise', :identifier => 'myent', :environment => Environment.default)
ent.contact_email = 'contact@invalid.com'
- c = Contact.new(:dest => ent, :subject => 'hi molly')
+ c = build(Contact, :dest => ent)
response = Contact::Sender.deliver_mail(c)
assert_equal c.email, response.from
assert_equal c.subject, response.subject
@@ -23,7 +23,7 @@ class ContactSenderTest < Test::Unit::TestCase
should 'deliver mail to contact_email' do
ent = Enterprise.new(:name => 'my enterprise', :identifier => 'myent', :environment => Environment.default)
ent.contact_email = 'contact@invalid.com'
- c = Contact.new(:dest => ent)
+ c = build(Contact, :dest => ent)
response = Contact::Sender.deliver_mail(c)
assert_includes response.to, c.dest.contact_email
end
@@ -34,28 +34,28 @@ class ContactSenderTest < Test::Unit::TestCase
ent.contact_email = 'contact@invalid.com'
ent.add_admin(admin)
assert ent.save!
- c = Contact.new(:dest => ent)
+ c = build(Contact, :dest => ent)
response = Contact::Sender.deliver_mail(c)
assert_includes response.to, admin.email
end
should 'deliver a copy of email if requester wants' do
ent = Enterprise.new(:name => 'my enterprise', :identifier => 'myent', :environment => Environment.default)
- c = Contact.new(:dest => ent, :email => 'requester@invalid.com', :receive_a_copy => true)
+ c = build(Contact, :dest => ent, :email => 'requester@invalid.com', :receive_a_copy => true)
response = Contact::Sender.deliver_mail(c)
assert_includes response.cc, c.email
end
should 'not deliver a copy of email if requester dont wants' do
ent = Enterprise.new(:name => 'my enterprise', :identifier => 'myent', :environment => Environment.default)
- c = Contact.new(:dest => ent, :email => 'requester@invalid.com', :receive_a_copy => false)
+ c = build(Contact, :dest => ent, :email => 'requester@invalid.com', :receive_a_copy => false)
response = Contact::Sender.deliver_mail(c)
assert_nil response.cc
end
should 'only deliver mail to email of person' do
person = create_user('contacted_user').person
- c = Contact.new(:dest => person)
+ c = build(Contact, :dest => person)
response = Contact::Sender.deliver_mail(c)
assert_equal [person.email], response.to
end
@@ -63,7 +63,7 @@ class ContactSenderTest < Test::Unit::TestCase
should 'identify the sender in the message headers' do
recipient = create_user('contacted_user').person
sender = create_user('sender_user').person
- c = Contact.new(:dest => recipient, :sender => sender)
+ c = build(Contact, :dest => recipient, :sender => sender)
sent_message = Contact::Sender.deliver_mail(c)
assert_equal 'sender_user', sent_message['X-Noosfero-Sender'].to_s
end
--
libgit2 0.21.2