Skip to content

Commit

Permalink
fixed removeActivity by foreignId
Browse files Browse the repository at this point in the history
  • Loading branch information
tschellenbach committed Nov 12, 2014
1 parent 6ef092b commit dbb7e29
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/lib/feed.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ StreamFeed.prototype = {
removeActivity : function(activityId, callback) {
/*
* Removes the activity by activityId
* feed.removeActivity(activityId);
* Or
* feed.removeActivity({'foreign_id': foreignId});
*/
Expand All @@ -49,9 +50,8 @@ StreamFeed.prototype = {
if (activityId.foreignId) {
params.foreign_id = '1';
}
var xhr = this.client.
delete ( {
'url' : 'feed/' + this.feedUrl + '/' + activityId + '/',
var xhr = this.client.delete( {
'url' : 'feed/' + this.feedUrl + '/' + identifier + '/',
'qs' : params,
'signature' : this.signature
}, callback);
Expand Down
7 changes: 6 additions & 1 deletion test/integration/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,12 @@ describe('Stream client', function () {
expect(response.statusCode).to.eql(201);
user1.removeActivity({foreignId: 'add:1'}, function(error, response, body) {
expect(response.statusCode).to.eql(200);
done();
user1.get({limit:10}, function(error, response, body) {
expect(response.statusCode).to.eql(200);
expect(body['results'][0]['id']).not.to.eql(activityId);
expect(body['results'][0]['foreign_id']).not.to.eql('add:1');
done();
});
});
}
user1.addActivity(activity, remove);
Expand Down

0 comments on commit dbb7e29

Please sign in to comment.