aboutsummaryrefslogtreecommitdiffstats
path: root/docs/spec/sourceLinkSpec.js
diff options
context:
space:
mode:
authorJulien Bouquillon2013-05-10 23:06:18 +0200
committerBrian Ford2013-07-11 14:40:06 -0700
commit61fb5863df4afe0fad688a44ff78b245b8439db2 (patch)
tree67b40d4347d3f394681aaa1c671758d5b7708774 /docs/spec/sourceLinkSpec.js
parenta4ec297925f052bf9ea1aba9f584eaaf7472fb93 (diff)
downloadangular.js-61fb5863df4afe0fad688a44ff78b245b8439db2.tar.bz2
feat(ngDocs): add links to source for API
- add tests - the link points to the gruntUtil.getVersion().number tree on github
Diffstat (limited to 'docs/spec/sourceLinkSpec.js')
-rw-r--r--docs/spec/sourceLinkSpec.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/docs/spec/sourceLinkSpec.js b/docs/spec/sourceLinkSpec.js
new file mode 100644
index 00000000..3dc73cc8
--- /dev/null
+++ b/docs/spec/sourceLinkSpec.js
@@ -0,0 +1,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>');
+ });
+
+ });
+
+});