Skip to content

Commit

Permalink
fix(routes): PATCH /accounts/{id} password update response 204 (#212)
Browse files Browse the repository at this point in the history
  • Loading branch information
Taekyoon authored and gr2m committed Oct 24, 2016
1 parent 7633f02 commit 1e54c68
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 5 additions & 1 deletion routes/accounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,11 @@ function accountRoutes (server, options, next) {
})

.then(function (json) {
reply(json).code(201)
if (profile) {
reply(json).code(201)
} else {
reply(json).code(204)
}
})

.catch(function (error) {
Expand Down
5 changes: 2 additions & 3 deletions tests/integration/routes/accounts/patch-accounts-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,8 @@ getServer(function (error, server) {

server.inject(routeOptions, function (response) {
t.is(couchdb.pendingMocks()[0], undefined, 'all mocks satisfied')
delete response.result.meta
t.is(response.statusCode, 201, 'returns 201 status')
t.is(response.result.data.attributes.username, 'pat-doe', 'returns the right content')
t.is(response.statusCode, 204, 'returns 204 status')
t.is(response.result, null, 'returns no content')
t.end()
})
})
Expand Down

0 comments on commit 1e54c68

Please sign in to comment.