Software /
code /
prosody
Comparison
spec/util_stanza_spec.lua @ 11085:5705d151ea11
util.stanza: Get 'by' from context instead
Zash> <error by=?> should go where? extra.by? context? source?
Zash> In Prosody this would usually be module.host or a bare user/room JID
MattJ> Zash: context
MattJ> context.by, basically the opposite of context.actor
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 26 Sep 2020 18:07:33 +0200 |
parent | 11084:5e09a3389adb |
child | 11086:2846b6226a8e |
comparison
equal
deleted
inserted
replaced
11084:5e09a3389adb | 11085:5705d151ea11 |
---|---|
232 end, "got stanza of type error"); | 232 end, "got stanza of type error"); |
233 end); | 233 end); |
234 | 234 |
235 it("should accept util.error objects", function () | 235 it("should accept util.error objects", function () |
236 local s = st.message({ to = "touser", from = "fromuser", id = "123", type = "chat" }, "Hello"); | 236 local s = st.message({ to = "touser", from = "fromuser", id = "123", type = "chat" }, "Hello"); |
237 local e = errors.new({ type = "modify", condition = "not-acceptable", text = "Bork bork bork", extra = { by = "this.test" } }); | 237 local e = errors.new({ type = "modify", condition = "not-acceptable", text = "Bork bork bork" }, { by = "this.test" }); |
238 local r = st.error_reply(s, e); | 238 local r = st.error_reply(s, e); |
239 | 239 |
240 assert.are.equal(r.name, s.name); | 240 assert.are.equal(r.name, s.name); |
241 assert.are.equal(r.id, s.id); | 241 assert.are.equal(r.id, s.id); |
242 assert.are.equal(r.attr.to, s.attr.from); | 242 assert.are.equal(r.attr.to, s.attr.from); |