aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2019-11-25 20:52:01 +0100
committerKim Alvefur <zash@zash.se>2019-11-25 20:52:01 +0100
commit52b7181979bcee9000acf1c90e85934976e4da6a (patch)
treeb016011e7c177c36a6f9c301630b7f3458b5f78c /spec
parent11095184a53cc144e37560b7bbbf4de19ce669c7 (diff)
downloadprosody-52b7181979bcee9000acf1c90e85934976e4da6a.tar.gz
prosody-52b7181979bcee9000acf1c90e85934976e4da6a.zip
util.stanza: Check that argument to error_reply is a stanza
Diffstat (limited to 'spec')
-rw-r--r--spec/util_stanza_spec.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/util_stanza_spec.lua b/spec/util_stanza_spec.lua
index 3b9084fa..23cdbeb9 100644
--- a/spec/util_stanza_spec.lua
+++ b/spec/util_stanza_spec.lua
@@ -214,6 +214,12 @@ describe("util.stanza", function()
assert.are.equal(#r.tags, 1);
assert.are.equal(r.tags[1].tags[1].name, "service-unavailable");
end);
+
+ it("should reject not-stanzas", function ()
+ assert.has.error_match(function ()
+ st.error_reply(not "a stanza", "modify", "bad-request");
+ end, "expected stanza");
+ end);
end);
describe("should reject #invalid", function ()