From 61fb5863df4afe0fad688a44ff78b245b8439db2 Mon Sep 17 00:00:00 2001
From: Julien Bouquillon
Date: Fri, 10 May 2013 23:06:18 +0200
Subject: feat(ngDocs): add links to source for API
- add tests
- the link points to the gruntUtil.getVersion().number tree on github
---
docs/spec/sourceLinkSpec.js | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
create mode 100644 docs/spec/sourceLinkSpec.js
(limited to 'docs/spec/sourceLinkSpec.js')
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(' Improve this doc');
+ });
+
+ it('should have an "view source" button', function() {
+ expect(doc.html()).
+ toContain(' View source');
+ });
+
+ });
+
+});
--
cgit v1.2.3