about summary refs log tree commit diff stats
path: root/tests/functionaltests
diff options
context:
space:
mode:
Diffstat (limited to 'tests/functionaltests')
-rw-r--r--tests/functionaltests/functionaltests.c1
-rw-r--r--tests/functionaltests/test_roster.c29
-rw-r--r--tests/functionaltests/test_roster.h1
3 files changed, 31 insertions, 0 deletions
diff --git a/tests/functionaltests/functionaltests.c b/tests/functionaltests/functionaltests.c
index 5e8656b7..bee95ad3 100644
--- a/tests/functionaltests/functionaltests.c
+++ b/tests/functionaltests/functionaltests.c
@@ -83,6 +83,7 @@ int main(int argc, char* argv[]) {
         PROF_FUNC_TEST(sends_new_item),
         PROF_FUNC_TEST(sends_new_item_nick),
         PROF_FUNC_TEST(sends_remove_item),
+        PROF_FUNC_TEST(sends_remove_item_nick),
         PROF_FUNC_TEST(sends_nick_change),
 
         PROF_FUNC_TEST(send_software_version_request),
diff --git a/tests/functionaltests/test_roster.c b/tests/functionaltests/test_roster.c
index aa06016e..c16764be 100644
--- a/tests/functionaltests/test_roster.c
+++ b/tests/functionaltests/test_roster.c
@@ -93,6 +93,35 @@ sends_remove_item(void **state)
 }
 
 void
+sends_remove_item_nick(void **state)
+{
+    prof_connect_with_roster(
+        "<item jid='buddy1@localhost' name='Bobby' subscription='both'/>"
+        "<item jid='buddy2@localhost' subscription='both'/>"
+    );
+
+    stbbr_for_query("jabber:iq:roster",
+        "<iq id='*' type='set'>"
+            "<query xmlns='jabber:iq:roster'>"
+                "<item jid='buddy1@localhost' subscription='remove'/>"
+            "</query>"
+        "</iq>"
+    );
+
+    prof_input("/roster remove Bobby");
+
+    assert_true(stbbr_received(
+        "<iq type='set' id='*'>"
+            "<query xmlns='jabber:iq:roster'>"
+                "<item jid='buddy1@localhost' subscription='remove'/>"
+            "</query>"
+        "</iq>"
+    ));
+
+    assert_true(prof_output_exact("Roster item removed: buddy1@localhost"));
+}
+
+void
 sends_nick_change(void **state)
 {
     prof_connect_with_roster(
diff --git a/tests/functionaltests/test_roster.h b/tests/functionaltests/test_roster.h
index 9b34e82a..885dfc55 100644
--- a/tests/functionaltests/test_roster.h
+++ b/tests/functionaltests/test_roster.h
@@ -1,4 +1,5 @@
 void sends_new_item(void **state);
 void sends_new_item_nick(void **state);
 void sends_remove_item(void **state);
+void sends_remove_item_nick(void **state);
 void sends_nick_change(void **state);