 
   test "render/2 renders html and text emails with assigns" do
     name = "Paul"
-    email = Emails.email_with_assigns(%{name: name})
+    email = Email.email_with_assigns(%{name: name})
     assert email.html_body =~ "<strong>#{name}</strong>"
     assert email.text_body =~ name
 
     name = "Paul"
-    email = Emails.email_with_already_assigned_user(%{name: name})
+    email = Email.email_with_already_assigned_user(%{name: name})
     assert email.html_body =~ "<strong>#{name}</strong>"
     assert email.text_body =~ name
   end
 
   test "render/2 renders html body if template extension is .html" do
-    email = Emails.html_email
+    email = Email.html_email
 
     assert email.html_body =~ "HTML body"
     assert email.text_body == nil
   end
 
   test "render/2 renders text body if template extension is .text" do
-    email = Emails.text_email
+    email = Email.text_email
 
     assert email.html_body == nil
     assert email.text_body =~ "TEXT body"

    use Phoenix.View, root: "test/support/templates", namespace: Bamboo.EmailView
  end

  defmodule Emails do
    use Bamboo.Phoenix, view: EmailView

    def text_and_html_email_with_layout do


  test "render/2 raises if template doesn't exist" do
    assert_raise Phoenix.Template.UndefinedError, fn ->
      Email.no_template
    end
  end

  test "render/2 raises if you pass an invalid template extension" do
    assert_raise ArgumentError, ~r/must end in either ".html" or ".text"/, fn ->
      Email.invalid_template
    end
  end

