       "<auth xmlns='#{ns_sasl}' mechanism='PLAIN'>AHVzZXJuYW1lAHBhc3N3b3Jk</auth>"
   end
 
+  test "auth" do
+    assert Stanza.auth("PLAIN") |> Stanza.to_xml ==
+      "<auth xmlns='#{ns_sasl}' mechanism='PLAIN'></auth>"
+  end
+
   test "bind" do
     assert Stanza.bind("hedwig") |> Stanza.to_xml =~
       ~r"<iq type='set' id='(.*)'><bind xmlns='#{ns_bind}'><resource>hedwig</resource></bind></iq>"

    assert Stanza.message("test@localhost", "chat", "Hello") |> Stanza.to_xml =~
      ~r"<message to='test@localhost' type='chat' id='(.*)' xml:lang='en'><body>Hello</body></message>"
  end
end

  test "presence" do
    assert Stanza.presence |> Stanza.to_xml == "<presence/>"
  end
  
  test "presence/1" do
    assert Stanza.presence("subscribe") |> Stanza.to_xml == "<presence type='subscribe'/>"
  end

  test "presence/2" do
    assert Stanza.presence("room@muc.localhost/nick", "unavailable") |> Stanza.to_xml ==
