Commit c8e36b08bc643c05006df2e2eefa1c043e819e69

Authored by Daniela Feitosa
1 parent 4ef1070c

Fixed some tests

(ActionItem2042)
app/views/contact/sender/mail.rhtml
@@ -8,8 +8,8 @@ @@ -8,8 +8,8 @@
8 {:sender => @name, :target => @target, :environment => @environment} %></p> 8 {:sender => @name, :target => @target, :environment => @environment} %></p>
9 <%= _('Information about the user who sent this message:')%> 9 <%= _('Information about the user who sent this message:')%>
10 <ul> 10 <ul>
11 - <li><%= content_tag('b', _('Name')+': ') + @name%></li>  
12 - <li><%= content_tag('b', _('Email')+': ') + @email%></li> 11 + <li><%= content_tag('b', _('Name')+': ') + @name.to_s %></li>
  12 + <li><%= content_tag('b', _('Email')+': ') + @email.to_s %></li>
13 <% if @city || @state %> 13 <% if @city || @state %>
14 <li><%= content_tag('b', _('City and state')+': ') + (@city || '?')+'/'+(@state || '?') %></li> 14 <li><%= content_tag('b', _('City and state')+': ') + (@city || '?')+'/'+(@state || '?') %></li>
15 <% end %> 15 <% end %>
test/unit/contact_sender_test.rb
@@ -16,8 +16,8 @@ class ContactSenderTest &lt; Test::Unit::TestCase @@ -16,8 +16,8 @@ class ContactSenderTest &lt; Test::Unit::TestCase
16 ent.contact_email = 'contact@invalid.com' 16 ent.contact_email = 'contact@invalid.com'
17 c = build(Contact, :dest => ent) 17 c = build(Contact, :dest => ent)
18 response = Contact::Sender.deliver_mail(c) 18 response = Contact::Sender.deliver_mail(c)
19 - assert_equal c.email, response.from  
20 - assert_equal c.subject, response.subject 19 + assert_equal Environment.default.contact_email, response.from.to_s
  20 + assert_equal "[#{ent.name}] #{c.subject}", response.subject
21 end 21 end
22 22
23 should 'deliver mail to contact_email' do 23 should 'deliver mail to contact_email' do