You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ro...@apache.org on 2015/09/01 20:45:31 UTC

fauxton commit: updated refs/heads/master to b5affe1

Repository: couchdb-fauxton
Updated Branches:
  refs/heads/master be90e4ccd -> b5affe12a


use a stricter way to determine if db exists

avoids false positives like fauxton-seleniumtest2

code is covered by the testsuite itself :)

PR: #513
PR-URL: https://github.com/apache/couchdb-fauxton/pull/513
Reviewed-By: Benjamin Keen <be...@gmail.com>


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

Branch: refs/heads/master
Commit: b5affe12a10bb4fa7e4decb2f72f1f316f0814e9
Parents: be90e4c
Author: Robert Kowalski <ro...@apache.org>
Authored: Tue Sep 1 17:47:47 2015 +0200
Committer: Robert Kowalski <ro...@apache.org>
Committed: Tue Sep 1 20:45:18 2015 +0200

----------------------------------------------------------------------
 test/nightwatch_tests/custom-commands/checkForDatabaseCreated.js | 3 ++-
 test/nightwatch_tests/custom-commands/checkForDatabaseDeleted.js | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/b5affe12/test/nightwatch_tests/custom-commands/checkForDatabaseCreated.js
----------------------------------------------------------------------
diff --git a/test/nightwatch_tests/custom-commands/checkForDatabaseCreated.js b/test/nightwatch_tests/custom-commands/checkForDatabaseCreated.js
index 91c0941..7889f2e 100644
--- a/test/nightwatch_tests/custom-commands/checkForDatabaseCreated.js
+++ b/test/nightwatch_tests/custom-commands/checkForDatabaseCreated.js
@@ -36,7 +36,8 @@ CheckForDatabaseCreated.prototype.command = function (databaseName, timeout) {
   var intervalId = setInterval(function () {
     request(couchUrl + '/_all_dbs', function (er, res, body) {
       if (body) {
-        if (body.indexOf(databaseName) !== -1) {
+        var reg = new RegExp('"' + databaseName + '"', 'g');
+        if (reg.test(body)) {
           clearTimeout(timeOutId);
           console.log('database created: ' + databaseName);
           clearInterval(intervalId);

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/b5affe12/test/nightwatch_tests/custom-commands/checkForDatabaseDeleted.js
----------------------------------------------------------------------
diff --git a/test/nightwatch_tests/custom-commands/checkForDatabaseDeleted.js b/test/nightwatch_tests/custom-commands/checkForDatabaseDeleted.js
index c5c42ce..2888ea6 100644
--- a/test/nightwatch_tests/custom-commands/checkForDatabaseDeleted.js
+++ b/test/nightwatch_tests/custom-commands/checkForDatabaseDeleted.js
@@ -36,7 +36,8 @@ CheckForDatabaseDeleted.prototype.command = function (databaseName, timeout) {
   var intervalId = setInterval(function () {
     request(couchUrl + '/_all_dbs', function (er, res, body) {
       if (body) {
-        if (body.indexOf(databaseName) === -1) {
+        var reg = new RegExp('"' + databaseName + '"', 'g');
+        if (!reg.test(body)) {
           clearTimeout(timeOutId);
           console.log('database not there: ' + databaseName);
           clearInterval(intervalId);