diff --git a/core/test/ghost/api_permissions_spec.js b/core/test/ghost/api_permissions_spec.js index 7a7e177819..dd40aeb81c 100644 --- a/core/test/ghost/api_permissions_spec.js +++ b/core/test/ghost/api_permissions_spec.js @@ -23,7 +23,7 @@ describe("Role Model", function () { foundRoles.models.length.should.be.above(0); done(); - }, done); + }).then(null, done); }); it("can read roles", function (done) { @@ -31,7 +31,7 @@ describe("Role Model", function () { should.exist(foundRole); done(); - }, done); + }).then(null, done); }); it("can edit roles", function (done) { @@ -47,7 +47,7 @@ describe("Role Model", function () { updatedRole.get("name").should.equal("updated"); done(); - }, done); + }).then(null, done); }); it("can add roles", function (done) { @@ -63,7 +63,7 @@ describe("Role Model", function () { createdRole.attributes.description.should.equal(newRole.description); done(); - }, done); + }).then(null, done); }); it("can delete roles", function (done) { @@ -81,7 +81,7 @@ describe("Role Model", function () { hasRemovedId.should.equal(false); done(); - }, done); + }).then(null, done); }); }); @@ -104,7 +104,7 @@ describe("Permission Model", function () { foundPermissions.models.length.should.be.above(0); done(); - }, done); + }).then(null, done); }); it("can read permissions", function (done) { @@ -112,7 +112,7 @@ describe("Permission Model", function () { should.exist(foundPermission); done(); - }, done); + }).then(null, done); }); it("can edit permissions", function (done) { @@ -128,7 +128,7 @@ describe("Permission Model", function () { updatedPermission.get("name").should.equal("updated"); done(); - }, done); + }).then(null, done); }); it("can add permissions", function (done) { @@ -142,7 +142,7 @@ describe("Permission Model", function () { createdPerm.attributes.name.should.equal(newPerm.name); done(); - }, done); + }).then(null, done); }); it("can delete permissions", function (done) { @@ -160,6 +160,6 @@ describe("Permission Model", function () { hasRemovedId.should.equal(false); done(); - }, done); + }).then(null, done); }); }); \ No newline at end of file diff --git a/core/test/ghost/api_posts_spec.js b/core/test/ghost/api_posts_spec.js index e401488562..09ac8ed1f1 100644 --- a/core/test/ghost/api_posts_spec.js +++ b/core/test/ghost/api_posts_spec.js @@ -118,7 +118,7 @@ describe('Post Model', function () { secondPost.get('content').should.equal("Test Content 2"); done(); - }).otherwise(done); + }).then(null, done); }); @@ -133,7 +133,7 @@ describe('Post Model', function () { createdPost.get('slug').should.equal('apprehensive-titles-have-too-many-spaces'); done(); - }); + }).then(null, done); }); it('can delete', function (done) { @@ -197,6 +197,6 @@ describe('Post Model', function () { paginationResult.pages.should.equal(11); done(); - }, done); + }).then(null, done); }); }); diff --git a/core/test/ghost/api_settings_spec.js b/core/test/ghost/api_settings_spec.js index d6bc748ab0..97e349cbde 100644 --- a/core/test/ghost/api_settings_spec.js +++ b/core/test/ghost/api_settings_spec.js @@ -22,7 +22,7 @@ describe('Settings Model', function () { results.length.should.be.above(0); done(); - }, done); + }).then(null, done); }); it('can read', function (done) { @@ -46,7 +46,7 @@ describe('Settings Model', function () { done(); - }, done); + }).then(null, done); }); it('can edit single', function (done) { @@ -79,7 +79,7 @@ describe('Settings Model', function () { done(); - }, done); + }).then(null, done); }); it('can edit multiple', function (done) { @@ -121,7 +121,7 @@ describe('Settings Model', function () { done(); - }, done); + }).then(null, done); }); it('can add', function (done) { @@ -139,7 +139,7 @@ describe('Settings Model', function () { createdSetting.attributes.type.should.equal("general"); done(); - }, done); + }).then(null, done); }); it('can delete', function (done) { @@ -173,6 +173,6 @@ describe('Settings Model', function () { done(); - }, done); + }).then(null, done); }); }); \ No newline at end of file diff --git a/core/test/ghost/api_users_spec.js b/core/test/ghost/api_users_spec.js index 14f4060835..3ac95a2205 100644 --- a/core/test/ghost/api_users_spec.js +++ b/core/test/ghost/api_users_spec.js @@ -11,9 +11,9 @@ describe('User Model', function () { var UserModel = Models.User; beforeEach(function (done) { - helpers.resetData().then(function (result) { + helpers.resetData().then(function () { return when(helpers.insertDefaultUser()); - }).then(function (results) { + }).then(function () { done(); }, done); }); @@ -24,7 +24,7 @@ describe('User Model', function () { email_address: "test@test1.com" }; - helpers.resetData().then(function (result) { + helpers.resetData().then(function () { UserModel.add(userData).then(function (createdUser) { should.exist(createdUser); createdUser.has('uuid').should.equal(true); @@ -32,7 +32,7 @@ describe('User Model', function () { createdUser.attributes.email_address.should.eql(userData.email_address, "email address corred"); done(); - }, done); + }).then(null, done); }); }); @@ -45,7 +45,7 @@ describe('User Model', function () { return UserModel.add(userData).then(done, function (failure) { failure.message.should.eql('A user is already registered. Only one user for now!'); done(); - }); + }).then(null, done); }); it('can browse', function (done) { @@ -57,7 +57,7 @@ describe('User Model', function () { done(); - }, done); + }).then(null, done); }); it('can read', function (done) { @@ -81,7 +81,7 @@ describe('User Model', function () { done(); - }, done); + }).then(null, done); }); @@ -106,7 +106,7 @@ describe('User Model', function () { done(); - }, done); + }).then(null, done); }); it("can get effective permissions", function (done) { @@ -116,7 +116,7 @@ describe('User Model', function () { effectivePermissions.length.should.be.above(0); done(); - }, done); + }).then(null, done); }); it('can delete', function (done) { @@ -152,6 +152,6 @@ describe('User Model', function () { hasDeletedId.should.equal(false); done(); - }, done); + }).then(null, done); }); }); \ No newline at end of file diff --git a/core/test/ghost/export_spec.js b/core/test/ghost/export_spec.js index 29758e8f8c..69c8ed6965 100644 --- a/core/test/ghost/export_spec.js +++ b/core/test/ghost/export_spec.js @@ -29,7 +29,7 @@ describe("Export", function () { exportStub.restore(); done(); - }, done); + }).then(null, done); }); describe("001", function () { @@ -52,7 +52,7 @@ describe("Export", function () { }); done(); - }, done); + }).then(null, done); }); }); }); \ No newline at end of file diff --git a/core/test/ghost/frontend_helpers_index_spec.js b/core/test/ghost/frontend_helpers_index_spec.js index 6aed2f5813..e7b486a376 100644 --- a/core/test/ghost/frontend_helpers_index_spec.js +++ b/core/test/ghost/frontend_helpers_index_spec.js @@ -49,7 +49,7 @@ describe('Core Helpers', function () { compileSpy.restore(); done(); - }, done); + }).then(null, done); }); }); }); \ No newline at end of file diff --git a/core/test/ghost/ghost_spec.js b/core/test/ghost/ghost_spec.js index ba35e58110..e509f3acd5 100644 --- a/core/test/ghost/ghost_spec.js +++ b/core/test/ghost/ghost_spec.js @@ -45,7 +45,7 @@ describe("Ghost API", function () { ghost.dataProvider = oldDataProvider; done(); - }, done); + }).then(null, done); }); @@ -107,7 +107,7 @@ describe("Ghost API", function () { templateFn().should.equal('

HelloWorld

'); done(); - }, done); + }).then(null, done); }); it("loads templates for helpers", function (done) { @@ -133,6 +133,6 @@ describe("Ghost API", function () { compileSpy.restore(); done(); - }, done); + }).then(null, done); }); }); \ No newline at end of file diff --git a/core/test/ghost/import_spec.js b/core/test/ghost/import_spec.js index 8d0150da5f..e4de9777d4 100644 --- a/core/test/ghost/import_spec.js +++ b/core/test/ghost/import_spec.js @@ -33,7 +33,7 @@ describe("Import", function () { importStub.restore(); done(); - }, done); + }).then(null, done); }); describe("001", function () { @@ -56,7 +56,7 @@ describe("Import", function () { return when.all(truncateOps); }).then(function () { return importer("001", exportData); - }).then(function (importResult) { + }).then(function () { // Grab the data from tables return when.all([ knex("users").select(), @@ -73,7 +73,7 @@ describe("Import", function () { importedData[2].length.should.equal(exportData.data.settings.length); done(); - }, done); + }).then(null, done); }); }); }); \ No newline at end of file diff --git a/core/test/ghost/permissions_spec.js b/core/test/ghost/permissions_spec.js index 9557cd714b..fd64ff8a04 100644 --- a/core/test/ghost/permissions_spec.js +++ b/core/test/ghost/permissions_spec.js @@ -14,9 +14,9 @@ var _ = require("underscore"), describe('permissions', function () { beforeEach(function (done) { - helpers.resetData().then(function (result) { + helpers.resetData().then(function () { return helpers.insertDefaultUser(); - }).then(function (results) { + }).then(function () { done(); }, done); }); @@ -82,7 +82,7 @@ describe('permissions', function () { actionsMap.should.equal(permissions.actionsMap); done(); - }, errors.throwError); + }).then(null, done); }); it('can add user to role', function (done) { @@ -111,7 +111,7 @@ describe('permissions', function () { updatedUser.related('roles').length.should.equal(existingUserRoles + 1); done(); - }); + }).then(null, done); }); it('can add user permissions', function (done) { @@ -135,7 +135,7 @@ describe('permissions', function () { updatedUser.related('permissions').length.should.equal(1); done(); - }); + }).then(null, done); }); it('can add role permissions', function (done) { @@ -170,7 +170,7 @@ describe('permissions', function () { updatedRole.related('permissions').length.should.equal(1); done(); - }); + }).then(null, done); }); it('does not allow edit post without permission', function (done) { @@ -193,9 +193,7 @@ describe('permissions', function () { }) .then(function () { errors.logError(new Error("Allowed edit post without permission")); - }, function () { - done(); - }); + }, done); }); it('allows edit post with permission', function (done) { @@ -235,9 +233,7 @@ describe('permissions', function () { }) .then(function () { done(); - }, function () { - errors.logError(new Error("Did not allow edit post with permission")); - }); + }, done); }); it('can use permissable function on Model to allow something', function (done) { @@ -246,8 +242,6 @@ describe('permissions', function () { return when.resolve(); }); - - // createTestUser() UserProvider.browse() .then(function (foundUser) { @@ -265,6 +259,8 @@ describe('permissions', function () { .otherwise(function () { permissableStub.restore(); errors.logError(new Error("Did not allow testUser")); + + done(); }); });