Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added failing test for custom markdown processing options, including

an additional mail that includes a URL
  • Loading branch information...
commit 6e55c4e78257ff6749b2d059389cfed10c75d549 1 parent f82ccf7
@colszowka colszowka authored
Showing with 14 additions and 0 deletions.
  1. +13 −0 test/markerb_test.rb
  2. +1 −0  test/views/notifier/link.markerb
View
13 test/markerb_test.rb
@@ -12,6 +12,12 @@ def contact(recipient, format_type)
end
end
+ def link(format_type)
+ mail(:to => 'foo@bar.com', :from => "john.doe@example.com") do |format|
+ format.send(format_type)
+ end
+ end
+
def multiple_format_contact(recipient)
@recipient = recipient
mail(:to => @recipient, :from => "john.doe@example.com", :template => "contact") do |format|
@@ -82,4 +88,11 @@ class MarkerbTest < ActiveSupport::TestCase
assert_equal "text/html", email.mime_type
assert_equal "<p>TEST Dual templates <strong>TEST rocks</strong>TEST !</p>", email.body.encoded.strip
end
+
+ test 'with custom markdown processing options' do
+ Markerb.processing_options = {:autolink => true}
+ email = Notifier.link(:html)
+ assert_equal "text/html", email.mime_type
+ assert_equal '<p>Hello from <a href="http://www.fcstpauli.com">http://www.fcstpauli.com</a></p>', email.body.encoded.strip
+ end
end
View
1  test/views/notifier/link.markerb
@@ -0,0 +1 @@
+Hello from http://www.fcstpauli.com
Please sign in to comment.
Something went wrong with that request. Please try again.