Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var tobi = require('tobi')
- , app = require('./my/app')
- , browser = tobi.createBrowser(app);
- browser.get('/login', function(res, $){
- $('form')
- .fill({ username: 'tj', password: 'tobi' })
- .submit(function(res, $){
- res.should.have.status(200);
- res.should.have.header('Content-Length');
- res.should.have.header('Content-Type', 'text/html; charset=utf-8');
- $('ul.messages').should.have.one('li', 'Successfully authenticated');
- browser.get('/login', function(res, $){
- res.should.have.status(200);
- $('ul.messages').should.have.one('li', 'Already authenticated');
- // We are finished testing, close the server
- app.close();
- });
- });
- });
Add Comment
Please, Sign In to add comment