Header
' + 'Body
' + ''; element = angular.element(html); spyOn($templateCache, 'put').and.callThrough(); compile(element)(scope); scope.$digest(); elementScope = element.scope(); modalId = $templateCache.put.calls.mostRecent().args[0]; }); it("uses angular-blocks to extend a modal template", function () { var modal = $templateCache.get(modalId); expect($templateCache.put).toHaveBeenCalled(); expect(modal.attr('extend-template')).toBe('components/views/bst-modal.html'); expect(modal.find('[data-block="modal-header"]').html()).toBe('Header'); expect(modal.find('[data-block="modal-body"]').html()).toBe('Body'); }); it("allows the opening of a modal dialog via bootstrap ui", function() { spyOn($uibModal, 'open').and.callThrough(); elementScope.openModal(); expect($uibModal.open).toHaveBeenCalled(); }); it("allows the specification of a modal templateUrl", function() { var html = ''; element = angular.element(html); compile(element)(scope); scope.$digest(); spyOn($uibModal, 'open').and.callThrough(); elementScope.openModal(); expect($uibModal.open.calls.mostRecent().args[0].templateUrl).toBe('blah.html'); }); });