Repository: couchdb-fauxton Updated Branches: refs/heads/master a72a672ce -> be342c77a
Fix cause of failing 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/be342c77 Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/be342c77 Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/be342c77 Branch: refs/heads/master Commit: be342c77af16298f1ae1b53ee70de41c9d15e506 Parents: a72a672 Author: Garren Smith <[email protected]> Authored: Thu Mar 26 10:24:32 2015 +0200 Committer: Garren Smith <[email protected]> Committed: Thu Mar 26 10:24:32 2015 +0200 ---------------------------------------------------------------------- .../tests/nightwatch/viewCreateBadView.js | 3 +-- .../custom-commands/populateDatabase.js | 26 ++++++++++++++++---- 2 files changed, 22 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/be342c77/app/addons/documents/tests/nightwatch/viewCreateBadView.js ---------------------------------------------------------------------- diff --git a/app/addons/documents/tests/nightwatch/viewCreateBadView.js b/app/addons/documents/tests/nightwatch/viewCreateBadView.js index 459c801..9fda24d 100644 --- a/app/addons/documents/tests/nightwatch/viewCreateBadView.js +++ b/app/addons/documents/tests/nightwatch/viewCreateBadView.js @@ -43,7 +43,6 @@ module.exports = { }, 'Visit url of broken view displays error': function (client) { - /*jshint multistr: true */ var waitTime = 10000, newDatabaseName = client.globals.testDatabaseName, baseUrl = client.globals.test_settings.launch_url; @@ -51,7 +50,7 @@ module.exports = { client .loginToGUI() .populateDatabase(newDatabaseName) - .url(baseUrl + '/#/database/' + newDatabaseName + '/_design/testdesigndoc/_view/brokenview') + .url(baseUrl + '/#/database/' + newDatabaseName + '/_design/brokenview/_view/brokenview') .waitForElementVisible('.alert-error', waitTime, false) .assert.containsText('.alert-error', 'builtin _sum function requires map values to be numbers or lists of numbers') .end(); http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/be342c77/test/nightwatch_tests/custom-commands/populateDatabase.js ---------------------------------------------------------------------- diff --git a/test/nightwatch_tests/custom-commands/populateDatabase.js b/test/nightwatch_tests/custom-commands/populateDatabase.js index 91af978..f17df8f 100644 --- a/test/nightwatch_tests/custom-commands/populateDatabase.js +++ b/test/nightwatch_tests/custom-commands/populateDatabase.js @@ -45,10 +45,6 @@ PopulateDatabase.prototype.command = function (databaseName, count) { "stubview": { "map": "function(doc) {\n emit('stub', 2);\n}", "reduce": "_count" - }, - 'brokenview': { - 'map': 'function (doc) {\n emit(doc._id, doc._id); \n}', - 'reduce': '_sum' } } }, @@ -59,7 +55,9 @@ PopulateDatabase.prototype.command = function (databaseName, count) { } createKeyView(null, function () { - that.emit('complete'); + createBrokenView(null, function () { + that.emit('complete'); + }); }); }); } @@ -81,6 +79,24 @@ PopulateDatabase.prototype.command = function (databaseName, count) { cb(); }); } + + function createBrokenView (err, cb) { + database.insert({ + views: { + 'brokenview': { + 'map': 'function (doc) {\n emit(doc._id, doc._id); \n}', + 'reduce': '_sum' + } + } + }, + '_design/brokenview', function (er) { + if (err) { + console.log('Error in nano populateDatabase Function: ' + + err.message); + } + cb(); + }); + } return this; };
