aboutsummaryrefslogtreecommitdiffstats
path: root/spec/util_datamapper_spec.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-03-26 12:53:29 +0100
committerKim Alvefur <zash@zash.se>2021-03-26 12:53:29 +0100
commitf36d7d1161b728e12f87cbf19007ed57c367a384 (patch)
treeaed6911b4090264f791d28b95e70afd504644528 /spec/util_datamapper_spec.lua
parentd1ccd87d551b9f10631eff3632801327aef0c09b (diff)
downloadprosody-f36d7d1161b728e12f87cbf19007ed57c367a384.tar.gz
prosody-f36d7d1161b728e12f87cbf19007ed57c367a384.zip
util.datamapper: Use attribute convenience function throughout
Diffstat (limited to 'spec/util_datamapper_spec.lua')
-rw-r--r--spec/util_datamapper_spec.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/spec/util_datamapper_spec.lua b/spec/util_datamapper_spec.lua
index 5246aced..af460e60 100644
--- a/spec/util_datamapper_spec.lua
+++ b/spec/util_datamapper_spec.lua
@@ -14,6 +14,7 @@ describe("util.datampper", function()
local disco, disco_info, disco_schema
setup(function()
+ -- a convenience function for simple attributes, there's a few of them
local function attr() return {type = "string"; xml = {attribute = true}} end
s = {
type = "object";
@@ -53,7 +54,7 @@ describe("util.datampper", function()
type = "object";
xml = {namespace = "urn:xmpp:reactions:0"; name = "reactions"};
properties = {
- to = {type = "string"; xml = {attribute = true; name = "id"}};
+ to = attr();
reactions = {type = "array"; items = {type = "string"; xml = {name = "reaction"}}};
};
};
@@ -63,8 +64,8 @@ describe("util.datampper", function()
xml = {name = "stanza-id"; namespace = "urn:xmpp:sid:0"};
type = "object";
properties = {
- id = {xml = {attribute = true}; type = "string"};
- by = {xml = {attribute = true}; type = "string"};
+ id = attr();
+ by = attr();
};
};
};