From 36c9e42de2d78af39600c588b06f2a52199ee8b6 Mon Sep 17 00:00:00 2001 From: Narretz Date: Sun, 5 Jan 2014 18:00:17 +0100 Subject: docs: fix the 'view source' button for snapshots Closes #5590 Closes #5641 --- docs/spec/ngdocSpec.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'docs/spec/ngdocSpec.js') diff --git a/docs/spec/ngdocSpec.js b/docs/spec/ngdocSpec.js index 29dd407a..fbbc2905 100644 --- a/docs/spec/ngdocSpec.js +++ b/docs/spec/ngdocSpec.js @@ -1,5 +1,7 @@ var ngdoc = require('../src/ngdoc.js'); var DOM = require('../src/dom.js').DOM; +var gruntUtil = require('../../lib/grunt/utils.js'); + describe('ngdoc', function() { var Doc = ngdoc.Doc; @@ -287,6 +289,33 @@ describe('ngdoc', function() { }); }); + + describe('api section', function() { + + it('should render a "view source" button with link to the source in master', function() { + var doc = new Doc({ + id: 'ng.abc', + name: 'ng.abc', + section: 'api', + ngdoc: 'service', + file: 'fooService.js', + line: '333' + }); + + if (gruntUtil.getVersion().full.indexOf('-') === -1) { + expect(doc.html().match(/^()/)[1]).toMatch( + /