Skip to content
Myr

examples: fix error handling in auth example

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Douglas Christopher Wilson · committed by Douglas Christopher Wilson · parent c221b85 · Browse files · 2 files+20 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+20 added−4 removed

  • tests:+16 added−1 removed
  • other:+4 added−3 removed

2 files+20 added−4 removed

modified:examples/auth/index.js+4 added-3 removed
modified:test/acceptance/auth.js+16 added-1 removed
20 unmodified lines
21 .get('/login')22 .expect(200, /<form/, done)23 })2425 it('should display login error', function(done){25 it('should display login error for bad user', function (done) {26 request(app)27 .post('/login')28 .type('urlencoded')29 .send('username=not-tj&password=foobar')
5 unmodified lines
35 .set('Cookie', getCookie(res))36 .expect(200, /Authentication failed/, done)37 })38 })3940 it('should display login error for bad password', function (done) {41 request(app)42 .post('/login')43 .type('urlencoded')44 .send('username=tj&password=nogood')45 .expect('Location', '/login')46 .expect(302, function (err, res) {47 if (err) return done(err)48 request(app)49 .get('/login')50 .set('Cookie', getCookie(res))51 .expect(200, /Authentication failed/, done)52 })53 })54 })5556 describe('GET /logout',function(){57 it('should redirect to /', function(done){
60 unmodified lines