Skip to content

Commit

Permalink
Added test for OPTIONS method
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrienCastex committed May 13, 2017
1 parent 2012d40 commit 0533082
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/tests/options.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
var webdav = require('../../lib/index.js'),
request = require('request')

module.exports = (test, options, index) => test('options method', isValid =>
{
var server = new webdav.WebDAVServer();
server.start(options.port + index);
isValid = isValid.multiple(1, server);

request({
url: 'http://localhost:' + (options.port + index),
method: 'OPTIONS'
}, (e, res, body) => {
isValid(res.headers.allow && res.headers.allow.length >= 3 && /^[a-zA-Z,]+$/g.test(res.headers.allow));
})
})

0 comments on commit 0533082

Please sign in to comment.