Skip to content
This repository
Browse code

Improved test coverage (closes #7571) [joost]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7545 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit 6203d4574ca744215094bec97c5786bd047236d5 1 parent 39b77ca
David Heinemeier Hansson authored September 22, 2007

Showing 1 changed file with 19 additions and 0 deletions. Show diff stats Hide diff stats

  1. 19  actionmailer/test/mail_service_test.rb
19  actionmailer/test/mail_service_test.rb
@@ -245,6 +245,14 @@ def custom_content_type_attributes
245 245
     body         "testing"
246 246
   end
247 247
 
  248
+  def return_path
  249
+    recipients   "no.one@nowhere.test"
  250
+    subject      "return path test"
  251
+    from         "some.one@somewhere.test"
  252
+    body         "testing"
  253
+    headers      "return-path" => "another@somewhere.test"
  254
+  end
  255
+
248 256
   class <<self
249 257
     attr_accessor :received_body
250 258
   end
@@ -858,6 +866,17 @@ def test_custom_content_type_attributes
858 866
     assert_match %r{format=flowed}, mail['content-type'].to_s
859 867
     assert_match %r{charset=utf-8}, mail['content-type'].to_s
860 868
   end
  869
+
  870
+  def test_return_path_with_create
  871
+    mail = TestMailer.create_return_path
  872
+    assert_equal "<another@somewhere.test>", mail['return-path'].to_s
  873
+  end
  874
+
  875
+  def test_return_path_with_deliver
  876
+    ActionMailer::Base.delivery_method = :smtp
  877
+    TestMailer.deliver_return_path
  878
+    assert_match %r{^Return-Path: <another@somewhere.test>}, MockSMTP.deliveries[0][0]
  879
+  end
861 880
 end
862 881
 
863 882
 end # uses_mocha

0 notes on commit 6203d45

Please sign in to comment.
Something went wrong with that request. Please try again.