Jasmine has a concept called spies
. You can check if it was called, what parameters it had, if it returned something or even how many times it was called.
Consider:
it('can accept a post to update it', function() {
var postToAccept = {
title: 'Title',
body: 'Post'
};
spyOn(rest, 'update').and.callThrough();
post.accept(postToAccept);
expect(rest.update).toHaveBeenCalledWith(postToAccept);
});