about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--tests/functionaltests/functionaltests.c1
-rw-r--r--tests/functionaltests/test_receipts.c21
-rw-r--r--tests/functionaltests/test_receipts.h1
3 files changed, 23 insertions, 0 deletions
diff --git a/tests/functionaltests/functionaltests.c b/tests/functionaltests/functionaltests.c
index 8650ea3a..f244b95a 100644
--- a/tests/functionaltests/functionaltests.c
+++ b/tests/functionaltests/functionaltests.c
@@ -67,6 +67,7 @@ int main(int argc, char* argv[]) {
         PROF_FUNC_TEST(receive_self_carbon),
 
         PROF_FUNC_TEST(send_receipt_request),
+        PROF_FUNC_TEST(send_receipt_on_request),
     };
 
     return run_tests(all_tests);
diff --git a/tests/functionaltests/test_receipts.c b/tests/functionaltests/test_receipts.c
index 0360fda8..357663f3 100644
--- a/tests/functionaltests/test_receipts.c
+++ b/tests/functionaltests/test_receipts.c
@@ -27,3 +27,24 @@ send_receipt_request(void **state)
         "</message>"
     ));
 }
+
+void
+send_receipt_on_request(void **state)
+{
+    prof_input("/receipts send on");
+
+    prof_connect();
+
+    stbbr_send(
+        "<message id=\"msg12213\" type=\"chat\" to=\"stabber@localhost/profanity\" from=\"someuser@server.org/profanity\">"
+            "<body>Wants a receipt</body>"
+            "<request xmlns=\"urn:xmpp:receipts\"/>"
+        "</message>"
+    );
+
+    assert_true(stbbr_received(
+        "<message id=\"*\" to=\"someuser@server.org/profanity\">"
+            "<received id=\"msg12213\" xmlns=\"urn:xmpp:receipts\"/>"
+        "</message>"
+    ));
+}
diff --git a/tests/functionaltests/test_receipts.h b/tests/functionaltests/test_receipts.h
index efd18f1e..5bfa5d1f 100644
--- a/tests/functionaltests/test_receipts.h
+++ b/tests/functionaltests/test_receipts.h
@@ -1,2 +1,3 @@
 void send_receipt_request(void **state);
+void send_receipt_on_request(void **state);