Revision 383633613639 () - Diff

Link to this snippet: https://friendpaste.com/cHYk0lOyrtYPOo8gXaonH
Embed:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
apiEasy = require "api-easy"
assert = require "assert"
xml2js = require "xml2js"

parser = new xml2js.Parser()

suite = apiEasy.describe "Content module"
suite.use "apps-beta.meego.com", 80

# Distributions
suite.discuss("Getting list of distributions")
.path("/ocs/v1/content/distributions")
.get()
.expect(200)
.expect "Should contain a list", (error, response, body) ->
parser = new xml2js.Parser()
parser.on "end", (result) ->
assert.equal result.meta.statuscode, 100
assert.equal result.data.distribution.length, result.meta.totalitems
parser.parseString body
.undiscuss()
.unpath()

suite.run()