   end
 
   test "render/2 renders html and text emails" do
-    email = Emails.text_and_html_email
+    email = Email.text_and_html_email
 
     assert email.html_body =~ "HTML body"
     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 renders html and text emails with assigns" do
    name = "Paul"
    email = Email.email_with_assigns(%{name: name})
    assert email.html_body =~ "<strong>#{name}</strong>"
    assert email.text_body =~ name

    name = "Paul"
    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 = 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 = Email.text_email

    assert email.html_body == nil
    assert email.text_body =~ "TEXT body"
