Skip to content

Commit

Permalink
Adds negative foaf tests for direct messages. Fixes #257.
Browse files Browse the repository at this point in the history
  • Loading branch information
epicmonkey committed Jul 8, 2015
1 parent 54c9466 commit e48295f
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions test/functional/mutual_freinds.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,41 @@ describe("MutualFriends", function() {
})
})
})

it('should not comment on direct message unless you are recipient', function(done) {
var body = 'body'
request
.post(app.config.host + '/v1/posts')
.send({ post: { body: body }, meta: { feeds: [marsContext.username] }, authToken: lunaContext.authToken })
.end(function(err, res) {
var post = res.body.posts
funcTestHelper.createComment(body, post.id, zeusContext.authToken, function(err, res) {
res.body.should.not.be.empty
res.body.should.have.property('err')
res.body.err.should.eql('Not found')
done()
})
})
})

it('should not like direct message unless you are recipient', function(done) {
var body = 'body'
request
.post(app.config.host + '/v1/posts')
.send({ post: { body: body }, meta: { feeds: [marsContext.username] }, authToken: lunaContext.authToken })
.end(function(err, res) {
var post = res.body.posts
request
.post(app.config.host + '/v1/posts/' + post.id + '/like')
.send({ authToken: zeusContext.authToken })
.end(function(err, res) {
res.body.should.not.be.empty
res.body.should.have.property('err')
res.body.err.should.eql('Not found')
done()
})
})
})
})
})
})

0 comments on commit e48295f

Please sign in to comment.