aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2020-09-26 17:26:31 +0200
committerKim Alvefur <zash@zash.se>2020-09-26 17:26:31 +0200
commit27273548aec77ac761a23426a31a089283506750 (patch)
tree2721a67a00a2adf70129199dd6e42affac3d452d /spec
parent05a3d574dce37d28621bfd35703b2a2283cfd1bd (diff)
downloadprosody-27273548aec77ac761a23426a31a089283506750.tar.gz
prosody-27273548aec77ac761a23426a31a089283506750.zip
util.stanza: Support getting 'by' from util.error object
Diffstat (limited to 'spec')
-rw-r--r--spec/util_stanza_spec.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/spec/util_stanza_spec.lua b/spec/util_stanza_spec.lua
index efe3e47e..ec392611 100644
--- a/spec/util_stanza_spec.lua
+++ b/spec/util_stanza_spec.lua
@@ -234,7 +234,7 @@ describe("util.stanza", function()
it("should accept util.error objects", function ()
local s = st.message({ to = "touser", from = "fromuser", id = "123", type = "chat" }, "Hello");
- local e = errors.new({ type = "modify", condition = "not-acceptable", text = "Bork bork bork" });
+ local e = errors.new({ type = "modify", condition = "not-acceptable", text = "Bork bork bork", extra = { by = "this.test" } });
local r = st.error_reply(s, e);
assert.are.equal(r.name, s.name);
@@ -246,6 +246,7 @@ describe("util.stanza", function()
assert.are.equal(r.tags[1].attr.type, e.type);
assert.are.equal(r.tags[1].tags[1].name, e.condition);
assert.are.equal(r.tags[1].tags[2]:get_text(), e.text);
+ assert.are.equal("this.test", r.tags[1].attr.by);
end);
end);