-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfeatured_clyp_spec.js
More file actions
39 lines (34 loc) · 932 Bytes
/
featured_clyp_spec.js
File metadata and controls
39 lines (34 loc) · 932 Bytes
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
28
29
30
31
32
33
34
35
36
37
38
39
var frisby = require('./node_modules/frisby');
var options = require('./options').create();
var GET_URL = options.apiUrl;
// Make sure that the /featuredlist request works
frisby.create('GET /featuredlist')
.get(options.featuredListResource)
.expectStatus(200)
//.inspectJSON()
.afterJSON(function(json) {
for(i = 0; i < json.length; i++) {
testList(json[i].Location);
}
})
.toss();
function testList(Location) {
frisby.create('Check that the list returns 200')
// Location contains URL of the specific list
.get(Location)
.expectStatus(200)
//.inspectJSON()
.toss();
};
// Run tests on the /trendinghashtaglist feature
frisby.create('GET /trendinghashtaglist')
.get(GET_URL + 'trendinghashtaglist')
.expectStatus(200)
// .inspectJSON()
.afterJSON(function(json) {
for(i = 0; i < json.length; i++) {
expect(json[i].Title).toBeDefined();
expect(json[i].Location).toBeDefined();
}
})
.toss();