Updated Branches: refs/heads/1813-verify-install 9380c0363 -> 48e7a6750
Add check to see if test db exists Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/5acac38d Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/5acac38d Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/5acac38d Branch: refs/heads/1813-verify-install Commit: 5acac38d9ac41c8e32283a8408b8229b4f62a023 Parents: 9380c03 Author: Garren Smith <[email protected]> Authored: Tue Oct 15 18:35:51 2013 +0200 Committer: Garren Smith <[email protected]> Committed: Tue Oct 15 18:35:51 2013 +0200 ---------------------------------------------------------------------- src/fauxton/app/addons/verifyinstall/routes.js | 1 + .../addons/verifyinstall/templates/main.html | 12 ++++---- src/fauxton/app/addons/verifyinstall/views.js | 29 ++++++++++++++------ 3 files changed, 28 insertions(+), 14 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb/blob/5acac38d/src/fauxton/app/addons/verifyinstall/routes.js ---------------------------------------------------------------------- diff --git a/src/fauxton/app/addons/verifyinstall/routes.js b/src/fauxton/app/addons/verifyinstall/routes.js index 8a104db..e5024ba 100644 --- a/src/fauxton/app/addons/verifyinstall/routes.js +++ b/src/fauxton/app/addons/verifyinstall/routes.js @@ -23,6 +23,7 @@ function(app, FauxtonAPI, VerifyInstall) { routes: { 'verifyinstall': "verifyInstall" }, + selectedHeader: "Verify", verifyInstall: function () { this.setView('#dashboard-content', new VerifyInstall.Main({})); http://git-wip-us.apache.org/repos/asf/couchdb/blob/5acac38d/src/fauxton/app/addons/verifyinstall/templates/main.html ---------------------------------------------------------------------- diff --git a/src/fauxton/app/addons/verifyinstall/templates/main.html b/src/fauxton/app/addons/verifyinstall/templates/main.html index 5e897cc..fa41907 100644 --- a/src/fauxton/app/addons/verifyinstall/templates/main.html +++ b/src/fauxton/app/addons/verifyinstall/templates/main.html @@ -24,27 +24,27 @@ the License. <tbody> <tr> <td> Create Database </td> - <td id="create-database"> </td> + <td id="create-database" class="status"> </td> </tr> <tr> <td> Create Document </td> - <td id="create-document"> </td> + <td id="create-document" class="status"> </td> </tr> <tr> <td> Update Document </td> - <td id="update-document"> </td> + <td id="update-document" class="status"> </td> </tr> <tr> <td> Delete Document </td> - <td id="delete-document"> </td> + <td id="delete-document" class="status"> </td> </tr> <tr> <td> Create View </td> - <td id="create-view"> </td> + <td id="create-view" class="status"> </td> </tr> <tr> <td> Replication </td> - <td id="replicate"> </td> + <td id="replicate" class="status"> </td> </tr> </tbody> </table> http://git-wip-us.apache.org/repos/asf/couchdb/blob/5acac38d/src/fauxton/app/addons/verifyinstall/views.js ---------------------------------------------------------------------- diff --git a/src/fauxton/app/addons/verifyinstall/views.js b/src/fauxton/app/addons/verifyinstall/views.js index 297c2cf..a35e2c3 100644 --- a/src/fauxton/app/addons/verifyinstall/views.js +++ b/src/fauxton/app/addons/verifyinstall/views.js @@ -19,9 +19,6 @@ define([ ], function(app, FauxtonAPI, VerifyInstall, Databases, Documents) { - // x - ✗ - // correct - ✓ - VerifyInstall.Main = FauxtonAPI.View.extend({ template: 'addons/verifyinstall/templates/main', @@ -75,8 +72,25 @@ function(app, FauxtonAPI, VerifyInstall, Databases, Documents) { }; }, + setupDB: function (db) { + var deferred = FauxtonAPI.Deferred(); + + db.fetch() + .then(function () { + return db.destroy(); + }, function () { + deferred.resolve(); + }) + .then(function () { + deferred.resolve(); + }); + + return deferred; + }, + startTest: function () { this.disableButton(); + this.$('.status').text(''); var doc, viewDoc, dbReplicate, setPass = this.setPass, @@ -85,11 +99,11 @@ function(app, FauxtonAPI, VerifyInstall, Databases, Documents) { formatError = this.formatError; var db = new Databases.Model({ - id: 'garren_testdb', - name: 'garren_testdb' + id: 'verifytestdb', + name: 'verifytestdb' }); - - db.destroy() + + this.setupDB(db) .then(function () { return db.save(); }, formatError('create-database')) @@ -194,7 +208,6 @@ function(app, FauxtonAPI, VerifyInstall, Databases, Documents) { }, formatError('replicate')); this.enableButton(); - //*** SET HEADERS } });
