4b1a1da652
closes #553 Update test: application -> use() should throw if not a function Fix lint Use arrow function Refactor test using arrow function Remove non mandatory brackets fix for merge Fix: missing refactor after merge Use arrow function for old generator
25 lines
653 B
JavaScript
25 lines
653 B
JavaScript
|
|
'use strict';
|
|
|
|
const request = require('../helpers/context').request;
|
|
|
|
describe('ctx.idempotent', () => {
|
|
describe('when the request method is idempotent', () => {
|
|
it('should return true', () => {
|
|
['GET', 'HEAD', 'PUT', 'DELETE', 'OPTIONS', 'TRACE'].forEach(check);
|
|
function check(method){
|
|
const req = request();
|
|
req.method = method;
|
|
req.idempotent.should.equal(true);
|
|
}
|
|
});
|
|
});
|
|
|
|
describe('when the request method is not idempotent', () => {
|
|
it('should return false', () => {
|
|
const req = request();
|
|
req.method = 'POST';
|
|
req.idempotent.should.equal(false);
|
|
});
|
|
});
|
|
});
|