about summary refs log tree commit diff stats
path: root/tests/test_cmd_join.c
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2014-03-08 00:23:52 +0000
committerJames Booth <boothj5@gmail.com>2014-03-08 00:23:52 +0000
commita94814f0a933af524c7aee0277667e0c41ba7d5c (patch)
tree4b33f85afeab4a5e21d49a18c475d319c1858fa7 /tests/test_cmd_join.c
parent2d54c565ce1fbcca5f14436e503ccced1495f2b5 (diff)
downloadprofani-tty-a94814f0a933af524c7aee0277667e0c41ba7d5c.tar.gz
Added invalid jid test for /join
Diffstat (limited to 'tests/test_cmd_join.c')
-rw-r--r--tests/test_cmd_join.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/test_cmd_join.c b/tests/test_cmd_join.c
index 88ca8c17..225aaf5b 100644
--- a/tests/test_cmd_join.c
+++ b/tests/test_cmd_join.c
@@ -67,6 +67,23 @@ void cmd_join_shows_usage_when_no_args(void **state)
     free(help);
 }
 
+void cmd_join_shows_error_message_when_invalid_room_jid(void **state)
+{
+    mock_cons_show_error();
+    CommandHelp *help = malloc(sizeof(CommandHelp));
+    gchar *args[] = { "//@@/", NULL };
+
+    mock_connection_status(JABBER_CONNECTED);
+
+    expect_cons_show_error("Specified room has incorrect format.");
+    expect_cons_show("");
+
+    gboolean result = cmd_join(args, *help);
+    assert_true(result);
+
+    free(help);
+}
+
 /*
 void cmd_connect_shows_usage_when_no_server_value(void **state)
 {