about summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2014-02-02 01:05:52 +0000
committerJames Booth <boothj5@gmail.com>2014-02-02 01:05:52 +0000
commit95c48a0f477d6ee7eb928cd9f11c3fa363754447 (patch)
tree82c21b6a99afcc71b72a1d21f7348ce2ff08e55f /tests
parent9d957e5f937e415875a310585e5e1e2a538d0499 (diff)
downloadprofani-tty-95c48a0f477d6ee7eb928cd9f11c3fa363754447.tar.gz
Test message when removing autojoin for non existent bookmark
Diffstat (limited to 'tests')
-rw-r--r--tests/test_cmd_bookmark.c19
-rw-r--r--tests/test_cmd_bookmark.h1
-rw-r--r--tests/testsuite.c1
3 files changed, 21 insertions, 0 deletions
diff --git a/tests/test_cmd_bookmark.c b/tests/test_cmd_bookmark.c
index 32a19e82..4dc12217 100644
--- a/tests/test_cmd_bookmark.c
+++ b/tests/test_cmd_bookmark.c
@@ -366,3 +366,22 @@ void cmd_bookmark_remove_shows_message_when_no_bookmark(void **state)
 
     free(help);
 }
+
+void cmd_bookmark_remove_autojoin_shows_message_when_no_bookmark(void **state)
+{
+    mock_bookmark_remove();
+    mock_cons_show();
+    char *jid = "room@conf.server";
+    CommandHelp *help = malloc(sizeof(CommandHelp));
+    gchar *args[] = { "remove", jid, "autojoin", NULL };
+
+    mock_connection_status(JABBER_CONNECTED);
+
+    expect_and_return_bookmark_remove(jid, TRUE, FALSE);
+    expect_cons_show("No bookmark exists for room@conf.server.");
+
+    gboolean result = cmd_bookmark(args, *help);
+    assert_true(result);
+
+    free(help);
+}
diff --git a/tests/test_cmd_bookmark.h b/tests/test_cmd_bookmark.h
index ca17b62e..ef8729ca 100644
--- a/tests/test_cmd_bookmark.h
+++ b/tests/test_cmd_bookmark.h
@@ -17,3 +17,4 @@ void cmd_bookmark_remove_removes_bookmark(void **state);
 void cmd_bookmark_remove_removes_autojoin(void **state);
 void cmd_bookmark_add_shows_message_when_upated(void **state);
 void cmd_bookmark_remove_shows_message_when_no_bookmark(void **state);
+void cmd_bookmark_remove_autojoin_shows_message_when_no_bookmark(void **state);
diff --git a/tests/testsuite.c b/tests/testsuite.c
index 47c90a07..a3be51cc 100644
--- a/tests/testsuite.c
+++ b/tests/testsuite.c
@@ -458,6 +458,7 @@ int main(int argc, char* argv[]) {
         unit_test(cmd_bookmark_remove_removes_autojoin),
         unit_test(cmd_bookmark_add_shows_message_when_upated),
         unit_test(cmd_bookmark_remove_shows_message_when_no_bookmark),
+        unit_test(cmd_bookmark_remove_autojoin_shows_message_when_no_bookmark),
     };