sum7/warehost-frontend
sum7
/
warehost-frontend
Archived
1
0
Fork 0
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.
warehost-frontend/tests/lib.coffee

22 lines
504 B
CoffeeScript

expect = require("chai").expect
request = require('request')
config = require('./config')
module.exports.login = (args,args2)->
j = request.jar()
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)->
expect(err).to.be.null
expect(res.statusCode).to.be.equal(200)
expect(body.data).to.be.true
call(j,body.session)
)