Diff

spec/util_error_spec.lua @ 11089:35d2260644d9

util.error: Extract error originator from stanza errors
author Kim Alvefur <zash@zash.se>
date Sat, 26 Sep 2020 18:13:27 +0200
parent 11081:0b68697450c5
child 11092:bd13aa89262d
line wrap: on
line diff
--- a/spec/util_error_spec.lua	Sat Sep 26 18:12:18 2020 +0200
+++ b/spec/util_error_spec.lua	Sat Sep 26 18:13:27 2020 +0200
@@ -48,12 +48,13 @@
 		it("works", function ()
 			local st = require "util.stanza";
 			local m = st.message({ type = "chat" });
-			local e = st.error_reply(m, "modify", "bad-request");
+			local e = st.error_reply(m, "modify", "bad-request", nil, "error.example");
 			local err = errors.from_stanza(e);
 			assert.truthy(errors.is_err(err));
 			assert.equal("modify", err.type);
 			assert.equal("bad-request", err.condition);
 			assert.equal(e, err.context.stanza);
+			assert.equal("error.example", err.context.by);
 		end);
 	end);