Browse Source

[2930] Add test for missing parameters

Michal 'vorner' Vaner 12 years ago
parent
commit
2ae9ac7bb5
1 changed files with 18 additions and 0 deletions
  1. 18 0
      src/lib/config/tests/ccsession_unittests.cc

+ 18 - 0
src/lib/config/tests/ccsession_unittests.cc

@@ -139,6 +139,24 @@ TEST_F(CCSessionTest, notify) {
             session.getMsgQueue()->get(1)->toWire();
 }
 
+// Test sending a notification
+TEST_F(CCSessionTest, notifyNoParams) {
+    ModuleCCSession mccs(ccspecfile("spec1.spec"), session, NULL, NULL, false,
+                         false);
+    mccs.notify("group", "event");
+    const ConstElementPtr notification(el(
+        "["
+        "   \"notifications/group\","
+        "   \"*\","
+        "   {"
+        "       \"notification\": [\"event\"]"
+        "   },"
+        "   -1"
+        "]"));
+    EXPECT_TRUE(notification->equals(*session.getMsgQueue()->get(1))) <<
+            session.getMsgQueue()->get(1)->toWire();
+}
+
 TEST_F(CCSessionTest, createAnswer) {
     ConstElementPtr answer;
     answer = createAnswer();