17 lines
420 B
CoffeeScript
17 lines
420 B
CoffeeScript
expect = require("chai").expect
|
|
request = require('request')
|
|
|
|
config = require('./config')
|
|
|
|
module.exports.login = (call)->
|
|
j = request.jar()
|
|
request({method: 'POST',uri: config.ADDRESS+"/login",json:{
|
|
username: config.testdata.username,
|
|
password: config.testdata.password
|
|
},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)
|
|
)
|