aboutsummaryrefslogtreecommitdiffstats
path: root/spec/util_stanza_spec.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2019-11-25 20:44:05 +0100
committerKim Alvefur <zash@zash.se>2019-11-25 20:44:05 +0100
commitb340e5e4628e2f5c136fe1f4300821d89ed4cb94 (patch)
tree603e11e382185e757035e937142d1c8e03c45e87 /spec/util_stanza_spec.lua
parent10aa40227bc374f95d39bf1c03224c7302f33955 (diff)
downloadprosody-b340e5e4628e2f5c136fe1f4300821d89ed4cb94.tar.gz
prosody-b340e5e4628e2f5c136fe1f4300821d89ed4cb94.zip
util.stanza: Check that argument to 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 38503ab7..7d710888 100644
--- a/spec/util_stanza_spec.lua
+++ b/spec/util_stanza_spec.lua
@@ -170,6 +170,12 @@ describe("util.stanza", function()
assert.are.equal(r.attr.type, "result");
assert.are.equal(#r.tags, 0, "A reply should not include children of the original stanza");
end);
+
+ it("should reject not-stanzas", function ()
+ assert.has.error_match(function ()
+ st.reply(not "a stanza");
+ end, "expected stanza");
+ end);
end);
describe("#error_reply()", function()