How to unit test $uibModal in Jasmine? (unit testing injected library)

So I am using $uibModal from bootstrap and I have the following code in my AngularJS controller:

vm.openPopup = function() {
  $uibModal.open({
    templateUrl: 'popup.html',
    controller: function() {
       var modal = this;

       modal.hi = function() {
         // some code here
       }
    }
  });
};

How would I go about calling the modal.hi function in Jasmine and unit testing it to make sure it works correctly?

Source: New feed
Source Url How to unit test $uibModal in Jasmine? (unit testing injected library)