Skip to content

Commit

Permalink
fix: should allow sending message on non-existent res
Browse files Browse the repository at this point in the history
  • Loading branch information
pemrouz committed Sep 15, 2016
1 parent c0189de commit b9913a9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ const normalize = (ripple, next = identity) => (name, type, value) => {
if (!req.name)
return next(values(ripple.resources).map(normalize(ripple)))

if (!resource)
return Promise.resolve([404, err(`cannot find ${req.name}`)])
// if (!resource)
// return Promise.resolve([404, err(`cannot find ${req.name}`)])

if (!req.type)
req = {
Expand Down
30 changes: 15 additions & 15 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -333,21 +333,21 @@ describe('Sync', function(){
)
})

it('should not send if invalid name', function(done){
sendrecv(
done
, [{ name: 'invalid' }]
, [404, 'cannot find invalid']
)
})

it('should not send if invalid name (shorthand)', function(done){
sendrecv(
done
, ['invalid']
, [404, 'cannot find invalid']
)
})
// it('should not send if invalid name', function(done){
// sendrecv(
// done
// , [{ name: 'invalid' }]
// , [404, 'cannot find invalid']
// )
// })

// it('should not send if invalid name (shorthand)', function(done){
// sendrecv(
// done
// , ['invalid']
// , [404, 'cannot find invalid']
// )
// })

it('should respond with 405 if type/verb not handled', function(done){
sendrecv(
Expand Down

0 comments on commit b9913a9

Please sign in to comment.