couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kxe...@apache.org
Subject [32/50] [abbrv] fauxton commit: updated refs/heads/import-master to b32c617
Date Tue, 01 Apr 2014 09:14:48 GMT
Fauxton: fix navigating back to previous page

Fixes #COUCHDB-2169


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

Branch: refs/heads/import-master
Commit: 56995aec6da3524bfaba8179312bf9c205cdd979
Parents: 34ffc38
Author: Robert Kowalski <rok@kowalski.gd>
Authored: Mon Mar 17 18:20:44 2014 +0100
Committer: Robert Kowalski <rok@kowalski.gd>
Committed: Mon Mar 17 18:20:44 2014 +0100

----------------------------------------------------------------------
 app/addons/auth/base.js          |  2 +-
 app/addons/auth/test/baseSpec.js | 34 ++++++++++++++++++++++++++++++++++
 2 files changed, 35 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/56995aec/app/addons/auth/base.js
----------------------------------------------------------------------
diff --git a/app/addons/auth/base.js b/app/addons/auth/base.js
index 7f69a7f..3354f53 100644
--- a/app/addons/auth/base.js
+++ b/app/addons/auth/base.js
@@ -50,7 +50,7 @@ function(app, FauxtonAPI, Auth) {
     };
 
     var authDenied = function () {
-      FauxtonAPI.navigate('/noAccess');
+      FauxtonAPI.navigate('/noAccess', {replace: true});
     };
 
     FauxtonAPI.auth.registerAuth(auth);

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/56995aec/app/addons/auth/test/baseSpec.js
----------------------------------------------------------------------
diff --git a/app/addons/auth/test/baseSpec.js b/app/addons/auth/test/baseSpec.js
new file mode 100644
index 0000000..1525306
--- /dev/null
+++ b/app/addons/auth/test/baseSpec.js
@@ -0,0 +1,34 @@
+// 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([
+      'api',
+      'addons/auth/base',
+      'core/auth',
+      'testUtils'
+], function (FauxtonAPI, Base, Auth, testUtils) {
+  var assert = testUtils.assert,
+      ViewSandbox = testUtils.ViewSandbox;
+
+  describe("Auth: Login", function () {
+
+    describe("failed login", function () {
+
+      it("redirects with replace: true set", function () {
+        var navigateSpy = sinon.spy(FauxtonAPI, 'navigate');
+        FauxtonAPI.auth = new Auth();
+        Base.initialize();
+        FauxtonAPI.auth.authDeniedCb();
+        assert.ok(navigateSpy.withArgs('/noAccess', {replace: true}).calledOnce);
+      });
+    });
+  });
+});


Mime
View raw message