cHYk0lOyrtYPOo8gXaonH changeset

Changeset383633613639 (b)
ParentNone (a)
ab
0+apiEasy = require "api-easy"
0+assert = require "assert"
0+xml2js = require "xml2js"
0+
0+parser = new xml2js.Parser()
0+
0+suite = apiEasy.describe "Content module"
0+suite.use "apps-beta.meego.com", 80
0+
0+# Distributions
0+suite.discuss("Getting list of distributions")
0+    .path("/ocs/v1/content/distributions")
0+    .get()
0+    .expect(200)
0+    .expect "Should contain a list", (error, response, body) ->
0+        parser = new xml2js.Parser()
0+        parser.on "end", (result) ->
0+            assert.equal result.meta.statuscode, 100
0+            assert.equal result.data.distribution.length, result.meta.totalitems
0+        parser.parseString body
0+    .undiscuss()
0+    .unpath()
0+
0+suite.run()
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
--- Revision None
+++ Revision 383633613639
@@ -0,0 +1,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()