-
Notifications
You must be signed in to change notification settings - Fork 1
/
json-routes-tests.js
38 lines (34 loc) · 1.13 KB
/
json-routes-tests.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
// This package is also tested in the `simple:rest` package.
if (Meteor.isServer) {
JsonRoutes.add('GET', 'case-insensitive-method-1', function (req, res) {
JsonRoutes.sendResult(res, {data: true});
});
JsonRoutes.add('Get', 'case-insensitive-method-2', function (req, res) {
JsonRoutes.sendResult(res, {data: true});
});
JsonRoutes.add('get', 'case-insensitive-method-3', function (req, res) {
JsonRoutes.sendResult(res, {data: true});
});
} else {
// Meteor.isClient
testAsyncMulti('JSON Routes - support case-insensitive HTTP method types', [
function (test, expect) {
HTTP.get('/case-insensitive-method-1', expect(function (err, res) {
test.equal(err, null);
test.equal(res.data, true);
}));
},
function (test, expect) {
HTTP.get('/case-insensitive-method-2', expect(function (err, res) {
test.equal(err, null);
test.equal(res.data, true);
}));
},
function (test, expect) {
HTTP.get('/case-insensitive-method-3', expect(function (err, res) {
test.equal(err, null);
test.equal(res.data, true);
}));
},
]);
}