-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspec.js
51 lines (47 loc) · 1.09 KB
/
spec.js
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
40
41
42
43
44
45
46
47
48
49
50
51
var app;
var expect = require('chai').expect;
var expectedApiDoc = require('../../../../../test/fixtures/basic-usage-api-doc-after-initialization.json');
var request = require('supertest');
before(function() {
app = require('./app.js');
});
it('should have a resource with multiple named parameters as resource basename', function(done) {
request(app)
.get('/v3/users/foo@bar')
.expect(200)
.expect(
{
id: 'foo',
org: 'bar'
},
done
);
});
it('should have a resource with multiple named parameters as a resource directory name', function(done) {
request(app)
.get('/v3/foo-bar/boo')
.expect(200)
.expect(
{
id: 'boo',
region: 'foo',
az: 'bar'
},
done
);
});
it('should have a resource with multiple named parameters as both of directory and base name', function(done) {
request(app)
.get('/v3/foo-bar/boo.png')
.expect(404)
.expect(
{
message: 'file not found',
id: 'boo',
region: 'foo',
az: 'bar',
type: 'png'
},
done
);
});