couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gar...@apache.org
Subject [1/6] fauxton commit: updated refs/heads/sidebar-fixes to 1ba9f1a
Date Mon, 18 Aug 2014 09:48:31 GMT
Repository: couchdb-fauxton
Updated Branches:
  refs/heads/sidebar-fixes [created] 1ba9f1a81


Fix changes api-url


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/1b84944b
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/1b84944b
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/1b84944b

Branch: refs/heads/sidebar-fixes
Commit: 1b84944b19eeede04d9924e475714defa439a6d9
Parents: 2283352
Author: Garren Smith <garren.smith@gmail.com>
Authored: Wed Aug 13 11:54:07 2014 +0200
Committer: Garren Smith <garren.smith@gmail.com>
Committed: Mon Aug 18 11:36:08 2014 +0200

----------------------------------------------------------------------
 app/addons/documents/routes.js          |  4 ++--
 app/addons/documents/tests/routeSpec.js | 35 ++++++++++++++++++++++++++++
 2 files changed, 37 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/1b84944b/app/addons/documents/routes.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/routes.js b/app/addons/documents/routes.js
index 3fd94f9..8413714 100644
--- a/app/addons/documents/routes.js
+++ b/app/addons/documents/routes.js
@@ -503,7 +503,7 @@ function(app, FauxtonAPI, Documents, Changes, Index, DocEditor, Databases,
Resou
       }
     },
 
-    changes: function (event) {
+    changes: function () {
       var docParams = app.getParams();
       this.data.database.buildChanges(docParams);
 
@@ -531,7 +531,7 @@ function(app, FauxtonAPI, Documents, Changes, Index, DocEditor, Databases,
Resou
       };
 
       this.apiUrl = function() {
-        return [this.data.database.url("apiurl"), this.data.database.documentation()];
+        return [this.data.database.url("changes-apiurl"), this.data.database.documentation()];
       };
     },
 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/1b84944b/app/addons/documents/tests/routeSpec.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/tests/routeSpec.js b/app/addons/documents/tests/routeSpec.js
new file mode 100644
index 0000000..0526240
--- /dev/null
+++ b/app/addons/documents/tests/routeSpec.js
@@ -0,0 +1,35 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+define([
+        'addons/documents/routes',
+        'testUtils'
+], function (Documents, testUtils) {
+  var assert = testUtils.assert;
+  var DocumentRoute = Documents.RouteObjects[2];
+
+  describe('Documents Route', function () {
+
+    describe('changes route', function () {
+
+      it('Should set correct changes api url', function () {
+        var docRoute = new DocumentRoute('changes', {}, ['fakeDB']);
+        docRoute.changes();
+
+        console.log('docRoute.apiUrl()', docRoute.apiUrl());
+        assert.ok(!!docRoute.apiUrl()[0].match(/\/database\/fakeDB\/_changes\?descending=true&limit=100&include_docs=true/));
+      });
+
+    });
+  });
+
+});
+


Mime
View raw message