aboutsummaryrefslogtreecommitdiffstats
path: root/spec/util_stanza_spec.lua
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
commit7954f16d5913ce2383e220c040e36b153ac522e3 (patch)
treeb016011e7c177c36a6f9c301630b7f3458b5f78c /spec/util_stanza_spec.lua
parent7fdb06225efa628956ee38d944bd45d811bac358 (diff)
downloadprosody-7954f16d5913ce2383e220c040e36b153ac522e3.tar.gz
prosody-7954f16d5913ce2383e220c040e36b153ac522e3.zip
util.stanza: Check that argument to error_reply is a stanza
Diffstat (limited to 'spec/util_stanza_spec.lua')
-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 ()