Software / code / prosody
Comparison
spec/util_stanza_spec.lua @ 10442:22db763c510c
util.stanza: Check that argument to reply is a stanza
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Mon, 25 Nov 2019 20:44:05 +0100 |
| parent | 9924:5a2e53bef031 |
| child | 10443:f28718f46196 |
comparison
equal
deleted
inserted
replaced
| 10441:f2c9abc71f08 | 10442:22db763c510c |
|---|---|
| 168 assert.are.equal(r.attr.to, s.attr.from); | 168 assert.are.equal(r.attr.to, s.attr.from); |
| 169 assert.are.equal(r.attr.from, s.attr.to); | 169 assert.are.equal(r.attr.from, s.attr.to); |
| 170 assert.are.equal(r.attr.type, "result"); | 170 assert.are.equal(r.attr.type, "result"); |
| 171 assert.are.equal(#r.tags, 0, "A reply should not include children of the original stanza"); | 171 assert.are.equal(#r.tags, 0, "A reply should not include children of the original stanza"); |
| 172 end); | 172 end); |
| 173 | |
| 174 it("should reject not-stanzas", function () | |
| 175 assert.has.error_match(function () | |
| 176 st.reply(not "a stanza"); | |
| 177 end, "expected stanza"); | |
| 178 end); | |
| 173 end); | 179 end); |
| 174 | 180 |
| 175 describe("#error_reply()", function() | 181 describe("#error_reply()", function() |
| 176 it("should work for <s>", function() | 182 it("should work for <s>", function() |
| 177 -- Test stanza | 183 -- Test stanza |