diff options
author | Kim Alvefur <zash@zash.se> | 2019-11-25 20:52:01 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2019-11-25 20:52:01 +0100 |
commit | 7954f16d5913ce2383e220c040e36b153ac522e3 (patch) | |
tree | b016011e7c177c36a6f9c301630b7f3458b5f78c /spec/util_stanza_spec.lua | |
parent | 7fdb06225efa628956ee38d944bd45d811bac358 (diff) | |
download | prosody-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.lua | 6 |
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 () |