mirror of
https://github.com/expressjs/express.git
synced 2026-03-13 08:13:05 +08:00
committed by
Douglas Christopher Wilson
parent
a24f27aba7
commit
21cf522dcd
@@ -105,7 +105,7 @@ app.use(function(err, req, res, next){
|
||||
// invoke next() and do not respond.
|
||||
app.use(function(req, res){
|
||||
res.status(404);
|
||||
res.send({ error: "Lame, can't find that" });
|
||||
res.send({ error: "Sorry, can't find that" })
|
||||
});
|
||||
|
||||
/* istanbul ignore next */
|
||||
|
||||
@@ -97,9 +97,9 @@ describe('web-service', function(){
|
||||
describe('when requesting an invalid route', function(){
|
||||
it('should respond with 404 json', function(done){
|
||||
request(app)
|
||||
.get('/api/something?api-key=bar')
|
||||
.expect('Content-Type', /json/)
|
||||
.expect(404, '{"error":"Lame, can\'t find that"}', done)
|
||||
.get('/api/something?api-key=bar')
|
||||
.expect('Content-Type', /json/)
|
||||
.expect(404, '{"error":"Sorry, can\'t find that"}', done)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user