Permalink
Browse files

add spec for partial rendering

closes #1 #8
  • Loading branch information...
1 parent e378fcf commit 6cd3e543d0eb15d055a1a098543dea16a663cfb2 @nashby nashby committed Oct 20, 2012
Showing with 15 additions and 1 deletion.
  1. +13 −1 test/markerb_test.rb
  2. +1 −0 test/views/notifier/_user_info.markerb
  3. +1 −0 test/views/notifier/user.markerb
View
@@ -18,6 +18,12 @@ def link(format_type)
end
end
+ def user(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|
@@ -95,4 +101,10 @@ class MarkerbTest < ActiveSupport::TestCase
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
+
+ test 'with partial' do
+ email = Notifier.user(:html)
+ assert_equal "text/html", email.mime_type
+ assert_equal '<p>woot! <strong>Partial</strong></p>', email.body.encoded.strip
+ end
+end
@@ -0,0 +1 @@
+woot! **Partial**
@@ -0,0 +1 @@
+<%= render :partial => 'user_info' %>

0 comments on commit 6cd3e54

Please sign in to comment.