Fix POST status code, thanks to @lagoLast

This commit is contained in:
Typicode
2015-05-07 15:10:58 +02:00
parent 66b8a148ef
commit 73f919ddd0
2 changed files with 3 additions and 3 deletions

View File

@ -156,7 +156,7 @@ module.exports = function(source) {
var resource = db(req.params.resource)
.insert(req.body)
res.jsonp(resource)
res.status(201).jsonp(resource)
}
// PUT /:resource/:id

View File

@ -208,7 +208,7 @@ describe('Server', function() {
.send({body: 'foo', booleanValue: 'true', integerValue: '1'})
.expect('Content-Type', /json/)
.expect({id: 3, body: 'foo', booleanValue: true, integerValue: 1})
.expect(200)
.expect(201)
.end(function(err, res) {
if (err) return done(err)
assert.equal(db.posts.length, 3)
@ -222,7 +222,7 @@ describe('Server', function() {
.post('/refs')
.send({url: 'http://foo.com', postId: '1'})
.expect('Content-Type', /json/)
.expect(200)
.expect(201)
.end(function(err, res) {
if (err) return done(err)
assert.equal(db.refs.length, 2)