about summary refs log tree commit diff stats
path: root/stabbertests/test_connect.c
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2015-05-24 04:13:28 +0100
committerJames Booth <boothj5@gmail.com>2015-05-24 04:13:28 +0100
commit80665ea0514a6a9b93af7858a3db1467091f80df (patch)
tree4637310015e3389135f5edd46d767f28eea46f71 /stabbertests/test_connect.c
parent2241473ee62b7d5d60d20ef0c264e6080cbba8db (diff)
downloadprofani-tty-80665ea0514a6a9b93af7858a3db1467091f80df.tar.gz
Added rooms iq test
Diffstat (limited to 'stabbertests/test_connect.c')
-rw-r--r--stabbertests/test_connect.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/stabbertests/test_connect.c b/stabbertests/test_connect.c
index bc145da8..a09b8661 100644
--- a/stabbertests/test_connect.c
+++ b/stabbertests/test_connect.c
@@ -11,20 +11,17 @@
 #include "proftest.h"
 #include "xmpp/xmpp.h"
 #include "ui/stub_ui.h"
+#include "ui/window.h"
 #include "command/command.h"
 
 void
 connect_jid(void **state)
 {
-    char *connect = "/connect stabber@localhost port 5230";
-    char *password = "password";
-
-    stbbr_auth_passwd(password);
-    will_return(ui_ask_password, strdup(password));
+    will_return(ui_ask_password, strdup("password"));
 
     expect_cons_show("Connecting as stabber@localhost");
 
-    cmd_process_input(strdup(connect));
+    cmd_process_input(strdup("/connect stabber@localhost port 5230"));
     prof_process_xmpp();
 
     jabber_conn_status_t status = jabber_get_connection_status();
@@ -34,17 +31,28 @@ connect_jid(void **state)
 void
 connect_bad_password(void **state)
 {
-    char *connect = "/connect stabber@localhost port 5230";
-
-    stbbr_auth_passwd("password");
     will_return(ui_ask_password, strdup("badpassword"));
 
     expect_cons_show("Connecting as stabber@localhost");
     expect_cons_show_error("Login failed.");
 
-    cmd_process_input(strdup(connect));
+    cmd_process_input(strdup("/connect stabber@localhost port 5230"));
     prof_process_xmpp();
 
     jabber_conn_status_t status = jabber_get_connection_status();
     assert_true(status == JABBER_DISCONNECTED);
 }
+
+void
+sends_rooms_iq(void **state)
+{
+    will_return(ui_ask_password, strdup("password"));
+
+    expect_any_cons_show();
+
+    cmd_process_input(strdup("/connect stabber@localhost port 5230"));
+    prof_process_xmpp();
+
+    cmd_process_input(strdup("/rooms"));
+    prof_process_xmpp();
+}