如果频道名称未知,如何查找pusher是否订阅频道?显然,Jasmine并不是这样知道的:
subscribe: function(booking_request_id) {
if(channel && pusher) pusher.unsubscribe(); // error : not implemented thrown
channel = pusher.subscribe('booking_requests_' + booking_request_id);
channel.bind('async_notification', function (data) {
$rootScope.$apply(function () {
callback(data);
});
});
}