diff options
author | Kim Alvefur <zash@zash.se> | 2019-11-25 20:59:36 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2019-11-25 20:59:36 +0100 |
commit | 1396c094b678d3e8f91ef6ccf2ccb7cf330541c5 (patch) | |
tree | ca8b34f24020ebd3c47343ec16153f79e727c036 /spec/util_stanza_spec.lua | |
parent | cb1ec1605974c11ab431aa2537804956f1ecd579 (diff) | |
download | prosody-1396c094b678d3e8f91ef6ccf2ccb7cf330541c5.tar.gz prosody-1396c094b678d3e8f91ef6ccf2ccb7cf330541c5.zip |
util.stanza: Support the 'by' attribute on errors
This is to be used when the entity generating the error is not the same
as the one the stanza was directed to, e.g. an intermediate server.
Diffstat (limited to 'spec/util_stanza_spec.lua')
-rw-r--r-- | spec/util_stanza_spec.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/spec/util_stanza_spec.lua b/spec/util_stanza_spec.lua index 04458303..b754f59d 100644 --- a/spec/util_stanza_spec.lua +++ b/spec/util_stanza_spec.lua @@ -191,13 +191,14 @@ describe("util.stanza", function() local s = st.stanza("s", { to = "touser", from = "fromuser", id = "123" }) :tag("child1"); -- Make reply stanza - local r = st.error_reply(s, "cancel", "service-unavailable"); + local r = st.error_reply(s, "cancel", "service-unavailable", nil, "host"); assert.are.equal(r.name, s.name); assert.are.equal(r.id, s.id); assert.are.equal(r.attr.to, s.attr.from); assert.are.equal(r.attr.from, s.attr.to); assert.are.equal(#r.tags, 1); assert.are.equal(r.tags[1].tags[1].name, "service-unavailable"); + assert.are.equal(r.tags[1].attr.by, "host"); end); it("should work for <iq get>", function() |