diff --git a/core/test/ghost/api_posts_spec.js b/core/test/ghost/api_posts_spec.js index d53626a8f5..c4f64c1927 100644 --- a/core/test/ghost/api_posts_spec.js +++ b/core/test/ghost/api_posts_spec.js @@ -26,7 +26,7 @@ results.length.should.equal(2); done(); - }, done); + }).then(null, done); }); it('can read', function (done) { @@ -46,7 +46,7 @@ found.attributes.title.should.equal(firstPost.attributes.title); done(); - }, done); + }).then(null, done); }); it('can edit', function (done) { @@ -70,7 +70,7 @@ done(); - }, done); + }).then(null, done); }); it('can add', function (done) { @@ -87,7 +87,7 @@ createdPost.attributes.slug.should.equal(newPost.title.toLowerCase().replace(/ /g, '-'), 'slug is correct'); done(); - }, done); + }).then(null, done); }); it('can delete', function (done) { @@ -119,7 +119,7 @@ done(); - }, done); + }).then(null, done); }); }); }()); \ No newline at end of file diff --git a/core/test/ghost/api_settings_spec.js b/core/test/ghost/api_settings_spec.js index bb79726807..5bb9fd5e49 100644 --- a/core/test/ghost/api_settings_spec.js +++ b/core/test/ghost/api_settings_spec.js @@ -27,7 +27,7 @@ results.length.should.be.above(0); done(); - }, done); + }).then(null, done); }); it('can read', function (done) { @@ -51,7 +51,7 @@ done(); - }, done); + }).then(null, done); }); it('can edit single', function (done) { @@ -85,7 +85,7 @@ done(); - }, done); + }).then(null, done); }); it('can edit multiple', function (done) { @@ -128,7 +128,7 @@ done(); - }, done); + }).then(null, done); }); it('can add', function (done) { @@ -145,7 +145,7 @@ createdSetting.attributes.value.should.equal(newSetting.value, "value is correct"); done(); - }, done); + }).then(null, done); }); it('can delete', function (done) { @@ -179,7 +179,7 @@ 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 939d4146be..7311f90e03 100644 --- a/core/test/ghost/api_users_spec.js +++ b/core/test/ghost/api_users_spec.js @@ -20,6 +20,7 @@ }); it('can browse', function (done) { + users.browse().then(function (results) { should.exist(results); @@ -27,9 +28,8 @@ results.length.should.be.above(0); done(); - }, function (error) { - throw error; - }); + + }).then(null, done); }); it('can read', function (done) { @@ -43,18 +43,18 @@ firstUser = results.models[0]; - users.read({email_address: firstUser.attributes.email_address}).then(function (found) { + return users.read({email_address: firstUser.attributes.email_address}); - should.exist(found); + }).then(function (found) { - found.attributes.username.should.equal(firstUser.attributes.username); + should.exist(found); - done(); - }, function (error) { - throw error; - }); + found.attributes.username.should.equal(firstUser.attributes.username); + + done(); + + }).then(null, done); - }); }); it('can edit', function (done) { @@ -68,19 +68,17 @@ firstUser = results.models[0]; - users.edit({id: firstUser.id, url: "some.newurl.com"}).then(function (edited) { + return users.edit({id: firstUser.id, url: "some.newurl.com"}); - should.exist(edited); + }).then(function (edited) { - edited.attributes.url.should.equal('some.newurl.com'); + should.exist(edited); - done(); - }, function (error) { - throw error; - }); - }, function (error) { - throw error; - }); + edited.attributes.url.should.equal('some.newurl.com'); + + done(); + + }).then(null, done); }); it('can add', function (done) { @@ -97,9 +95,7 @@ createdUser.attributes.email_address.should.eql(userData.email_address, "email address corred"); done(); - }, function (error) { - throw error; - }); + }).then(null, done); }); it('can delete', function (done) { @@ -136,7 +132,8 @@ hasDeletedId.should.equal(false); done(); - }, done); + + }).then(null, done); }); });