Skip to content
Myr

deps: should@~4.0.0

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 b49453c · Browse files · 8 files+49 added−71 removed
This commit

State

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

Diff stats

8 files+49 added−71 removed

  • tests:+42 added−66 removed
  • other:+7 added−5 removed

8 files+49 added−71 removed

modified:examples/resource/app.js+5 added-3 removed
modified:test/acceptance/ejs.js+6 added-9 removed
modified:test/acceptance/mvc.js+10 added-17 removed
45 unmodified lines
46 describe('GET /users', function(){47 it('should display a list of users', function(done){48 request(app)49 .get('/users')50 .end(function(err, res){51 res.text.should.include('<h1>Users</h1>');52 res.text.should.include('>TJ<');53 res.text.should.include('>Guillermo<');54 res.text.should.include('>Nathan<');55 done();56 })50 .expect(/<h1>Users<\/h1>/)51 .expect(/>TJ</)52 .expect(/>Guillermo</)53 .expect(/>Nathan</)54 .expect(200, done)55 })56 })5758 describe('GET /user/:id', function(){59 describe('when present', function(){60 it('should display the user', function(done){61 request(app)62 .get('/user/0')65 .end(function(err, res){66 res.text.should.include('<h1>TJ <a href="/user/0/edit">edit');67 done();68 })63 .expect(200, /<h1>TJ <a href="\/user\/0\/edit">edit/, done)64 })6566 it('should display the users pets', function(done){67 request(app)68 .get('/user/0')74 .end(function(err, res){75 res.text.should.include('/pet/0">Tobi');76 res.text.should.include('/pet/1">Loki');77 res.text.should.include('/pet/2">Jane');78 done();79 })69 .expect(/\/pet\/0">Tobi/)70 .expect(/\/pet\/1">Loki/)71 .expect(/\/pet\/2">Jane/)72 .expect(200, done)73 })74 })7576 describe('when not present', function(){
46 unmodified lines
modified:test/acceptance/web-service.js+2 added-6 removed
96 unmodified lines
97 describe('when requesting an invalid route', function(){98 it('should respond with 404 json', function(done){99 request(app)100 .get('/api/something?api-key=bar')101 .end(function(err, res){102 res.should.have.status(404);103 res.should.be.json;104 res.text.should.equal('{"error":"Lame, can\'t find that"}');105 done();106 });101 .expect('Content-Type', /json/)102 .expect(404, '{"error":"Lame, can\'t find that"}', done)103 })104 })105})
modified:test/res.cookie.js+2 added-5 removed
87 unmodified lines
8889 request(app)90 .get('/')91 .end(function(err, res){92 res.headers['set-cookie'][0].should.not.include('Thu, 01 Jan 1970 00:00:01 GMT');92 res.headers['set-cookie'][0].should.not.containEql('Thu, 01 Jan 1970 00:00:01 GMT');93 done();94 })95 })96
6 unmodified lines
103 });104105 request(app)106 .get('/')107 .end(function(err, res){108 res.headers['set-cookie'][0].should.include('Max-Age=1');109 done();110 })107 .expect('Set-Cookie', /Max-Age=1/, done)108 })109110 it('should not mutate the options object', function(done){111 var app = express();
60 unmodified lines
modified:test/res.download.js+16 added-19 removed
12 unmodified lines
13 });1415 request(app)16 .get('/')17 .end(function(err, res){18 res.should.have.header('Content-Type', 'text/html; charset=UTF-8');19 res.should.have.header('Content-Disposition', 'attachment; filename="user.html"');20 res.text.should.equal('<p>{{user.name}}</p>');21 done();22 });17 .expect('Content-Type', 'text/html; charset=UTF-8')18 .expect('Content-Disposition', 'attachment; filename="user.html"')19 .expect(200, '<p>{{user.name}}</p>', done)20 })21 })2223 describe('.download(path, filename)', function(){
5 unmodified lines
29 });3031 request(app)32 .get('/')36 .end(function(err, res){37 res.should.have.header('Content-Type', 'text/html; charset=UTF-8');38 res.should.have.header('Content-Disposition', 'attachment; filename="document"');39 done();40 });33 .expect('Content-Type', 'text/html; charset=UTF-8')34 .expect('Content-Disposition', 'attachment; filename="document"')35 .expect(200, done)36 })37 })3839 describe('.download(path, fn)', function(){
6 unmodified lines
46 });4748 request(app)49 .get('/')55 .end(function(err, res){56 res.should.have.header('Content-Type', 'text/html; charset=UTF-8');57 res.should.have.header('Content-Disposition', 'attachment; filename="user.html"');58 });50 .expect('Content-Type', 'text/html; charset=UTF-8')51 .expect('Content-Disposition', 'attachment; filename="user.html"')52 .expect(200, function(err){53 assert.ifError(err)54 })55 })56 })5758 describe('.download(path, filename, fn)', function(){
6 unmodified lines
65 });6667 request(app)68 .get('/')73 .end(function(err, res){74 res.should.have.header('Content-Type', 'text/html; charset=UTF-8');75 res.should.have.header('Content-Disposition', 'attachment; filename="document"');76 });69 .expect('Content-Type', 'text/html; charset=UTF-8')70 .expect('Content-Disposition', 'attachment; filename="document"')71 .expect(200, function(err){72 assert.ifError(err)73 })74 })75 })7677 describe('on failure', function(){
38 unmodified lines
modified:test/res.redirect.js+6 added-10 removed
11 unmodified lines
12 });1314 request(app)15 .get('/')16 .end(function(err, res){17 res.statusCode.should.equal(302);18 res.headers.should.have.property('location', 'http://google.com');19 done();20 })16 .expect('location', 'http://google.com')17 .expect(302, done)18 })19 })2021 describe('.redirect(status, url)', function(){
133 unmodified lines
155156 request(app)157 .get('/')158 .set('Accept', 'application/octet-stream')162 .end(function(err, res){163 res.should.have.status(302);164 res.headers.should.have.property('location', 'http://google.com');159 .expect('location', 'http://google.com')160 .expect('content-length', '0')161 .expect(302, '', function(err, res){162 if (err) return done(err)163 res.headers.should.not.have.property('content-type');166 res.headers.should.have.property('content-length', '0');167 res.text.should.equal('');164 done();165 })166 })167 })
73 unmodified lines
modified:package.json+2 added-2 removed
63 unmodified lines
64 },65 "devDependencies": {66 "ejs": "~0.8.4",67 "istanbul": "0.2.10",68 "mocha": "~1.19.0",69 "should": "~3.3.1",68 "mocha": "~1.20.0",69 "should": "~4.0.0",70 "jade": "~0.30.0",71 "hjs": "~0.0.6",72 "stylus": "~0.40.0",73 "connect-redis": "~1.4.5",
16 unmodified lines