aboutsummaryrefslogtreecommitdiffstats
path: root/docs/spec/sourceLinkSpec.js
blob: 3dc73cc85c379d7abb0684392f53c298b271bc79 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
var ngdoc = require('../src/ngdoc.js');
var gruntUtil = require('../../lib/grunt/utils.js');

describe('Docs Links', function() {

  describe('links', function() {
    var doc;

    beforeEach(function() {
      doc = new ngdoc.Doc("@ngdoc function\n@name ng.filter:a\n@function");
      doc.section = 'api';
      doc.file = 'test.js';
      doc.line = 42;
      doc.parse();
    });

    it('should have an "improve this doc" button', function() {
      expect(doc.html()).
        toContain('<a href="http://github.com/angular/angular.js/edit/master/test.js" class="improve-docs btn btn-primary"><i class="icon-edit"> </i> Improve this doc</a>');
    });

    it('should have an "view source" button', function() {
      expect(doc.html()).
        toContain('<a href="http://github.com/angular/angular.js/tree/v' + gruntUtil.getVersion().number + '/test.js#L42" class="view-source btn btn-action"><i class="icon-zoom-in"> </i> View source</a>');
    });

  });

});