Guest User

Untitled

a guest
Jul 18th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. var tobi = require('tobi')
  2. , app = require('./my/app')
  3. , browser = tobi.createBrowser(app);
  4.  
  5. browser.get('/login', function(res, $){
  6. $('form')
  7. .fill({ username: 'tj', password: 'tobi' })
  8. .submit(function(res, $){
  9. res.should.have.status(200);
  10. res.should.have.header('Content-Length');
  11. res.should.have.header('Content-Type', 'text/html; charset=utf-8');
  12. $('ul.messages').should.have.one('li', 'Successfully authenticated');
  13. browser.get('/login', function(res, $){
  14. res.should.have.status(200);
  15. $('ul.messages').should.have.one('li', 'Already authenticated');
  16. // We are finished testing, close the server
  17. app.close();
  18. });
  19. });
  20. });
Add Comment
Please, Sign In to add comment