You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ga...@apache.org on 2015/07/21 19:11:46 UTC

[1/2] fauxton commit: updated refs/heads/master to c754c6c

Repository: couchdb-fauxton
Updated Branches:
  refs/heads/master b8bbb87c6 -> c754c6cac


Remove verifyinstall tests


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

Branch: refs/heads/master
Commit: c754c6cac20c189ab0959cf9f09b680dce6d11b1
Parents: d52cef0
Author: Garren Smith <ga...@gmail.com>
Authored: Tue Jul 21 17:01:29 2015 +0200
Committer: Garren Smith <ga...@gmail.com>
Committed: Tue Jul 21 19:11:20 2015 +0200

----------------------------------------------------------------------
 .../tests/nightwatch/testVerification.js        | 33 --------------------
 1 file changed, 33 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/c754c6ca/app/addons/verifyinstall/tests/nightwatch/testVerification.js
----------------------------------------------------------------------
diff --git a/app/addons/verifyinstall/tests/nightwatch/testVerification.js b/app/addons/verifyinstall/tests/nightwatch/testVerification.js
deleted file mode 100644
index 3772b8c..0000000
--- a/app/addons/verifyinstall/tests/nightwatch/testVerification.js
+++ /dev/null
@@ -1,33 +0,0 @@
-// 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.
-
-module.exports = {
-  'Run the Verification test' : function (client) {
-    var waitTime = client.globals.maxWaitTime,
-        baseUrl = client.globals.test_settings.launch_url;
-
-    client
-      .loginToGUI()
-      .url(baseUrl + '#verifyinstall')
-      .clickWhenVisible('#start')
-      .waitForElementVisible('.alert-success', waitTime, false)
-      .getText('html', function (result) {
-        var testPassed = result.value.indexOf('Success! Your CouchDB installation is working. Time to Relax.') !== -1;
-        if (!testPassed) {
-          console.error(result.value);
-        }
-
-        this.verify.ok(testPassed, 'Checking the verification set passed.');
-      })
-      .end();
-  }
-};


[2/2] fauxton commit: updated refs/heads/master to c754c6c

Posted by ga...@apache.org.
Trigger error on failed session

If a session fetch fails then fire an event


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

Branch: refs/heads/master
Commit: d52cef099e1ebc9cd4a1c530f4932e31b9aa627d
Parents: b8bbb87
Author: Garren Smith <ga...@gmail.com>
Authored: Mon Jul 20 11:55:51 2015 +0200
Committer: Garren Smith <ga...@gmail.com>
Committed: Tue Jul 21 19:11:20 2015 +0200

----------------------------------------------------------------------
 app/core/couchdbSession.js           | 13 +++++-----
 app/core/tests/couchdbSessionSpec.js | 42 +++++++++++++++++++++++++++++++
 2 files changed, 49 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/d52cef09/app/core/couchdbSession.js
----------------------------------------------------------------------
diff --git a/app/core/couchdbSession.js b/app/core/couchdbSession.js
index ee06a6f..2ef460e 100644
--- a/app/core/couchdbSession.js
+++ b/app/core/couchdbSession.js
@@ -35,8 +35,7 @@ function (FauxtonAPI) {
       },
 
       fetchUser: function (opt) {
-        var that = this,
-            options = opt || {},
+        var options = opt || {},
             currentUser = this.user(),
             fetch = _.bind(this.fetchOnce, this);
 
@@ -45,20 +44,22 @@ function (FauxtonAPI) {
         }
 
         return fetch(opt).then(function () {
-          var user = that.user();
+          var user = this.user();
 
           // Notify anyone listening on these events that either a user has changed
           // or current user is the same
           if (currentUser !== user) {
-            that.trigger('session:userChanged');
+            this.trigger('session:userChanged');
           } else {
-            that.trigger('session:userFetched');
+            this.trigger('session:userFetched');
           }
 
           // this will return the user as a value to all function that calls done on this
           // eg. session.fetchUser().done(user) { .. do something with user ..}
           return user;
-        });
+        }.bind(this), function (session, xhr, type, message) {
+          this.trigger('session:error', xhr, type, message);
+        }.bind(this));
       }
     })
   };

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/d52cef09/app/core/tests/couchdbSessionSpec.js
----------------------------------------------------------------------
diff --git a/app/core/tests/couchdbSessionSpec.js b/app/core/tests/couchdbSessionSpec.js
new file mode 100644
index 0000000..e067c90
--- /dev/null
+++ b/app/core/tests/couchdbSessionSpec.js
@@ -0,0 +1,42 @@
+// 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',
+      'testUtils'
+], function (FauxtonAPI, testUtils) {
+  var assert = testUtils.assert;
+
+  describe('CouchDBSession', function () {
+
+    it('triggers error on failed fetch', function () {
+      var called = false;
+
+      var session = FauxtonAPI.session;
+      session.on('session:error', function () {
+        called = true;
+      });
+
+      session.fetch = function () {
+        var promise = FauxtonAPI.Deferred();
+        promise.reject();
+        return promise;
+      };
+
+      session.fetchUser();
+
+      assert.ok(called);
+    });
+
+
+  });
+
+});