Commit a9c63d16093134a09b537c86bb8bc4cd65770f34

Authored by Daniela Feitosa
Committed by Antonio Terceiro
1 parent 0c40bf78

Replacing "<p>" by "\n" on invitation default message

(ActionItem1658)
app/models/invitation.rb
@@ -20,7 +20,7 @@ class Invitation &lt; Task @@ -20,7 +20,7 @@ class Invitation &lt; Task
20 20
21 before_create do |task| 21 before_create do |task|
22 if task.message && !task.message.match(/<url>/) 22 if task.message && !task.message.match(/<url>/)
23 - task.message += task.message_to_accept_invitation 23 + task.message += Invitation.default_message_to_accept_invitation
24 end 24 end
25 end 25 end
26 26
@@ -122,7 +122,7 @@ class Invitation &lt; Task @@ -122,7 +122,7 @@ class Invitation &lt; Task
122 raise 'You should implement mail_template in a subclass' 122 raise 'You should implement mail_template in a subclass'
123 end 123 end
124 124
125 - def message_to_accept_invitation  
126 - '<p>' + _('To accept invitation, please follow this link: <url>') + '</p>' 125 + def self.default_message_to_accept_invitation
  126 + "\n\n" + _('To accept invitation, please follow this link: <url>')
127 end 127 end
128 end 128 end
test/unit/invitation_test.rb
@@ -80,7 +80,7 @@ class InvitationTest &lt; ActiveSupport::TestCase @@ -80,7 +80,7 @@ class InvitationTest &lt; ActiveSupport::TestCase
80 :friend => friend, 80 :friend => friend,
81 :message => 'Hi <friend>, <user> is inviting you!' 81 :message => 'Hi <friend>, <user> is inviting you!'
82 ) 82 )
83 - assert_equal "Hi <friend>, <user> is inviting you!#{invitation.message_to_accept_invitation}", invitation.message 83 + assert_equal "Hi <friend>, <user> is inviting you!#{Invitation.default_message_to_accept_invitation}", invitation.message
84 end 84 end
85 85
86 should 'do nothing with message if user added url' do 86 should 'do nothing with message if user added url' do
@@ -95,6 +95,6 @@ class InvitationTest &lt; ActiveSupport::TestCase @@ -95,6 +95,6 @@ class InvitationTest &lt; ActiveSupport::TestCase
95 end 95 end
96 96
97 should 'have a message with url' do 97 should 'have a message with url' do
98 - assert_equal "<p>To accept invitation, please follow this link: <url></p>", Invitation.new.message_to_accept_invitation 98 + assert_equal "\n\nTo accept invitation, please follow this link: <url>", Invitation.default_message_to_accept_invitation
99 end 99 end
100 end 100 end