Software /
code /
prosody
Changeset
8597:6e5fbeaca0f4
util.stanza: Fix tests to call error_reply() correctly, and add tests to ensure it vaguely works
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Fri, 16 Mar 2018 14:24:53 +0000 |
parents | 8596:71da54c7f797 |
children | 8598:282d544d48f4 |
files | spec/util_stanza_spec.lua |
diffstat | 1 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/spec/util_stanza_spec.lua Fri Mar 16 08:47:51 2018 +0100 +++ b/spec/util_stanza_spec.lua Fri Mar 16 14:24:53 2018 +0000 @@ -134,12 +134,13 @@ local s = st.stanza("s", { to = "touser", from = "fromuser", id = "123" }) :tag("child1"); -- Make reply stanza - local r = st.error_reply(s); + local r = st.error_reply(s, "cancel", "service-unavailable"); 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"); end); it("should work for <iq get>", function() @@ -147,13 +148,14 @@ local s = st.stanza("iq", { to = "touser", from = "fromuser", id = "123", type = "get" }) :tag("child1"); -- Make reply stanza - local r = st.error_reply(s); + local r = st.error_reply(s, "cancel", "service-unavailable"); 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.attr.type, "error"); assert.are.equal(#r.tags, 1); + assert.are.equal(r.tags[1].tags[1].name, "service-unavailable"); end); end); end);