styling
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by TJ Holowaychuk · committed by TJ Holowaychuk · parent 9548e7d · Browse files · 2 files·+16 added−11 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+16 added−11 removed
- tests:+16 added−11 removed
Provenance
- Commit
83c8d65- Tree
a636ea4- Author
TJ Holowaychuk <tj@vision-media.ca>- Committer
TJ Holowaychuk <tj@vision-media.ca>- Parent
9548e7d
2 files changed+16 added−11 removed
modified:test/acceptance/auth.js+4 added-3 removed
71 unmodified lines7273747576767778798081828384858687888889899091929371 unmodified lines describe('GET /logout',function(){ it('should respond with 302 and clear cookie',function(done){ request(app) .get('/logout') .set('cookie',cookie) .set('Cookie', cookie) .end(function(res){ res.statusCode.should.equal(302); res.headers.should.not.have.property('set-cookie') done(); }) }) })
describe('GET /restricted (w. expired cookie)',function(){ it('should respond with 302',function(done){ request(app) .get('/restricted') .set('cookie',cookie) .expect(302,done) .set('Cookie', cookie) .expect(302, done) }) })})No newline at end of fileNo newline at end of filemodified:test/acceptance/blog.js+12 added-8 removed
14 unmodified lines15161718191920212223242526272728293031323333343536373839404141424344454647484749505152535455565755585960616263646566636768697071727374717576777814 unmodified lines describe('GET /', function(){ it('should have no posts', function(done){ request(app) .get('/') .expect(/you have no posts/,done) .expect(/you have no posts/, done) }) })
describe('GET /post/add', function(){ it('should require auth', function(done){ request(app) .get('/post/add') .expect(401,done) .expect(401, done) })
it('should login', function(done){ request(app) .get('/post/add') .set('Authorization',authorization) .expect(/<h1>New Post<\/h1>/,done) .expect(/<h1>New Post<\/h1>/, done) }) })
describe('POST /post', function(){ it('should require auth', function(done){ request(app) .post('/post') .expect(401,done) .expect(401, done) })
it('should redirect to / with no title or body', function(done){ request(app) .post('/post') .set('Authorization',authorization) .end(redirects(/\/$/,done)) .end(redirects(/\/$/, done)) })
it('should redirect to / with no body', function(done){ request(app) .post('/post') .set('Authorization',authorization) .set('Content-Type','application/x-www-form-urlencoded') .write('post[title]=Kittens') .end(redirects(/\/$/,done)) .end(redirects(/\/$/, done)) })
it('should redirect to /post/:post when successful', function(done){ request(app) .post('/post') .set('Authorization',authorization) .set('Content-Type','application/x-www-form-urlencoded') .write('post[title]=Kittens&post[body]=In+very+large+baskets') .end(redirects(/\/post\/\d+$/,done)) .end(redirects(/\/post\/\d+$/, done)) }) })
describe('GET /', function(){ it('should now list 1 post',function(done){ request(app) .get('/') .expect(/Display all 1 post/,done) .expect(/Display all 1 post/, done) }) })})No newline at end of fileNo newline at end of file