Return-Path: X-Original-To: apmail-couchdb-commits-archive@www.apache.org Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 291B610290 for ; Tue, 5 May 2015 13:57:57 +0000 (UTC) Received: (qmail 47419 invoked by uid 500); 5 May 2015 13:57:57 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 47375 invoked by uid 500); 5 May 2015 13:57:57 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 47366 invoked by uid 99); 5 May 2015 13:57:57 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 May 2015 13:57:57 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id DD05EDFFEF; Tue, 5 May 2015 13:57:56 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: benkeen@apache.org To: commits@couchdb.apache.org Message-Id: <6e228f50fec74f8c818859007bac7c94@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: fauxton commit: updated refs/heads/master to e9f4330 Date: Tue, 5 May 2015 13:57:56 +0000 (UTC) Repository: couchdb-fauxton Updated Branches: refs/heads/master 90c07fae8 -> e9f433030 fix for DB typeahead link This adds a test to confirm the db name typeahead field in the header of the Database page works as expected, and that the URL it redirects to doesn't include an invalid 'undefined' string at the end of it. Closes COUCHDB-2671 Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/e9f43303 Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/e9f43303 Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/e9f43303 Branch: refs/heads/master Commit: e9f43303042b7339b83b503deec3d926b212d81c Parents: 90c07fa Author: Ben Keen Authored: Wed Apr 22 11:53:29 2015 -0700 Committer: Ben Keen Committed: Tue May 5 06:57:46 2015 -0700 ---------------------------------------------------------------------- .../tests/nightwatch/switchDatabase.js | 33 ++++++++++++++++++++ app/addons/databases/views.js | 2 +- 2 files changed, 34 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/e9f43303/app/addons/databases/tests/nightwatch/switchDatabase.js ---------------------------------------------------------------------- diff --git a/app/addons/databases/tests/nightwatch/switchDatabase.js b/app/addons/databases/tests/nightwatch/switchDatabase.js new file mode 100644 index 0000000..137bb92 --- /dev/null +++ b/app/addons/databases/tests/nightwatch/switchDatabase.js @@ -0,0 +1,33 @@ +// 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 = { + 'Confirm selecting database via typeahead redirects properly': function (client) { + var waitTime = client.globals.maxWaitTime, + newDatabaseName = client.globals.testDatabaseName; + + client + .loginToGUI() + + // wait for the DB name typeahead field to appear in the header + .waitForElementPresent('#jump-to-db .search-autocomplete', waitTime, false) + .setValue('#jump-to-db .search-autocomplete', [newDatabaseName, client.Keys.ENTER]) + .waitForElementPresent('.index-pagination', waitTime, false) + + // now check we've redirected and the URL ends with /_all_docs + .url(function (result) { + var endsWithAllDocs = /all_docs$/.test(result.value); + this.assert.ok(endsWithAllDocs, 'Redirected properly'); + }) + .end(); + } +}; http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/e9f43303/app/addons/databases/views.js ---------------------------------------------------------------------- diff --git a/app/addons/databases/views.js b/app/addons/databases/views.js index eedf358..cbbebb1 100644 --- a/app/addons/databases/views.js +++ b/app/addons/databases/views.js @@ -151,7 +151,7 @@ function (app, Components, FauxtonAPI, Databases) { // TODO: switch to using a model, or Databases.databaseUrl() // Neither of which are in scope right now // var db = new Database.Model({id: dbname}); - var url = FauxtonAPI.urls('allDocs', 'app', app.utils.safeURLName(dbname)); + var url = FauxtonAPI.urls('allDocs', 'app', app.utils.safeURLName(dbname), ''); FauxtonAPI.navigate(url); } else { FauxtonAPI.addNotification({