Skip to content

Commit

Permalink
fix(routes): GET /accounts/123?include=foobar (#218)
Browse files Browse the repository at this point in the history
  • Loading branch information
shuhei authored and gr2m committed Oct 23, 2016
1 parent 5932559 commit 7633f02
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions routes/accounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ function accountRoutes (server, options, next) {
auth: false,
validate: {
headers: validations.sessionIdHeader,
query: validations.accountQuery,
failAction: joiFailAction
}
},
Expand Down
12 changes: 10 additions & 2 deletions tests/integration/routes/accounts/get-accounts-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,16 @@ getServer(function (error, server) {
})
})

group.test('with ?include=foobar', {todo: true}, function (t) {
t.end()
group.test('with ?include=foobar', function (t) {
server.inject({
method: 'GET',
url: '/accounts/abc1234?include=foobar',
headers: headers
}, function (response) {
t.is(response.statusCode, 400, 'returns 400 status')
t.deepEqual(response.result.errors[0].detail, 'Allowed value for ?include is \'profile\'', 'returns error message')
t.end()
})
})

group.end()
Expand Down

0 comments on commit 7633f02

Please sign in to comment.