| a | b | |
|---|
| 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() |
|---|
| ... | |
|---|