This repository has been archived on 2020-09-27. You can view files and clone it, but cannot push or open issues or pull requests.
2016-08-14 14:22:11 +02:00
|
|
|
expect = require("chai").expect
|
|
|
|
request = require('request')
|
|
|
|
|
|
|
|
config = require('./config')
|
|
|
|
|
2016-08-24 23:11:57 +02:00
|
|
|
module.exports.login = (args,args2)->
|
2016-08-14 14:22:11 +02:00
|
|
|
j = request.jar()
|
2016-08-24 23:11:57 +02:00
|
|
|
login = {
|
|
|
|
username: config.testdata.username,
|
|
|
|
password: config.testdata.password
|
|
|
|
}
|
|
|
|
call = args
|
|
|
|
if args2
|
|
|
|
login = args
|
|
|
|
call = args2
|
|
|
|
request({method: 'POST',uri: config.ADDRESS+"/login",json:login,jar:j},(err,res,body)->
|
2016-08-14 14:22:11 +02:00
|
|
|
expect(err).to.be.null
|
|
|
|
expect(res.statusCode).to.be.equal(200)
|
|
|
|
expect(body.data).to.be.true
|
|
|
|
call(j)
|
|
|
|
)
|