aboutsummaryrefslogtreecommitdiffstats
path: root/docs/api-guide
ModeNameSize
-rwxr-xr-xauthentication.md22724logstatsplain
-rw-r--r--content-negotiation.md4748logstatsplain
-rw-r--r--exceptions.md6345logstatsplain
-rw-r--r--fields.md15591logstatsplain
-rw-r--r--filtering.md17998logstatsplain
-rw-r--r--format-suffixes.md3050logstatsplain
-rwxr-xr-xgeneric-views.md18057logstatsplain
-rw-r--r--pagination.md7083logstatsplain
-rw-r--r--parsers.md8162logstatsplain
-rw-r--r--permissions.md13974logstatsplain
-rw-r--r--relations.md17783logstatsplain
-rw-r--r--renderers.md21024logstatsplain
-rw-r--r--requests.md6060logstatsplain
-rw-r--r--responses.md4674logstatsplain
-rw-r--r--reverse.md2506logstatsplain
-rw-r--r--routers.md9675logstatsplain
-rw-r--r--serializers.md28538logstatsplain
-rw-r--r--settings.md12009logstatsplain
-rw-r--r--status-codes.md4177logstatsplain
-rw-r--r--testing.md11749logstatsplain
-rw-r--r--throttling.md7967logstatsplain
-rw-r--r--views.md6839logstatsplain
-rw-r--r--viewsets.md10348logstatsplain
); expect(popoverElement.title()).toBe(''); expect(popoverElement.content()).toBe(''); })); it('should parse markdown content', inject(function(popoverElement, $compile) { element = angular.element( '<div style="margin:200px;" data-title="#title_text" data-content="#heading" popover></div>' ); body.append(element); $compile(element)($scope); $scope.$apply(); element.triggerHandler('click'); expect(popoverElement.title()).toBe('#title_text'); expect(popoverElement.content()).toBe('<h1>heading</h1>\n'); })); }); describe('foldout directive', function() { var $scope, parent, element, url, window; beforeEach(function() { module(function($provide, $animateProvider) { $provide.value('$window', window = angular.mock.createMockWindow()); $animateProvider.register('.foldout', function($timeout) { return { enter : function(element, done) { $timeout(done, 1000); }, removeClass : function(element, className, done) { $timeout(done, 500); }, addClass : function(element, className, done) { $timeout(done, 200); } } }); }); inject(function($rootScope, $compile, $templateCache, $rootElement, $animate) { $animate.enabled(true); url = '/page.html'; $scope = $rootScope.$new(); parent = angular.element('<div class="parent"></div>'); //we're injecting the element to the $rootElement since the changes in //$animate only detect and perform animations if the root element has //animations enabled. If the element is not apart of the DOM //then animations are skipped. element = angular.element('<div data-url="' + url + '" class="foldout" foldout></div>'); parent.append(element); $rootElement.append(parent); body.append($rootElement); $compile(parent)($scope); $scope.$apply(); }); }); it('should inform that it is loading', inject(function($httpBackend) { $httpBackend.expect('GET', url).respond('hello'); element.triggerHandler('click'); var kids = body.children(); var foldout = angular.element(kids[kids.length-1]); expect(foldout.html()).toContain('loading'); })); it('should download a foldout HTML page and animate the contents', inject(function($httpBackend, $timeout) { $httpBackend.expect('GET', url).respond('hello'); element.triggerHandler('click'); $httpBackend.flush(); $timeout.flushNext(0); $timeout.flushNext(1); $timeout.flushNext(0); $timeout.flushNext(1000); var kids = body.children(); var foldout = angular.element(kids[kids.length-1]); expect(foldout.text()).toContain('hello'); })); it('should hide then show when clicked again', inject(function($httpBackend, $timeout) { $httpBackend.expect('GET', url).respond('hello'); //enter element.triggerHandler('click'); $httpBackend.flush(); $timeout.flushNext(0); $timeout.flushNext(1); $timeout.flushNext(0); $timeout.flushNext(1000); //hide element.triggerHandler('click'); $timeout.flushNext(1); $timeout.flushNext(0); $timeout.flushNext(200); $timeout.flushNext(0); //show element.triggerHandler('click'); $timeout.flushNext(1); $timeout.flushNext(0); $timeout.flushNext(500); $timeout.flushNext(0); })); }); describe('DocsController fold', function() { var window, $scope, ctrl; beforeEach(function() { module(function($provide, $animateProvider) { $provide.value('$window', window = angular.mock.createMockWindow()); }); inject(function($rootScope, $controller, $location, $cookies, sections) { $scope = $rootScope.$new(); ctrl = $controller('DocsController',{ $scope : $scope, $location : $location, $window : window, $cookies : $cookies, sections : sections }); }); }); it('should download and reveal the foldover container', inject(function($compile, $httpBackend) { var url = '/page.html'; var fullUrl = '/notes/' + url; $httpBackend.expect('GET', fullUrl).respond('hello'); var element = angular.element('<div ng-include="docs_fold"></div>'); $compile(element)($scope); $scope.$apply(); $scope.fold(url); $httpBackend.flush(); })); }); });