couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robertkowal...@apache.org
Subject fauxton commit: updated refs/heads/master to b5affe1
Date Tue, 01 Sep 2015 18:45:31 GMT
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 <ben.keen@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 <robertkowalski@apache.org>
Authored: Tue Sep 1 17:47:47 2015 +0200
Committer: Robert Kowalski <robertkowalski@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);


Mime
View raw message