mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-25 02:31:59 -05:00
Merge pull request #5203 from jaswilli/jscs-whitespace
Upgrade grunt-jscs to fix whitespace linting.
This commit is contained in:
commit
f4a9f0c82d
23 changed files with 581 additions and 582 deletions
|
@ -83,13 +83,13 @@ CasperTest.begin('Content list shows correct post status', 5, function testStati
|
|||
casper.thenClick('.post-edit');
|
||||
casper.waitForSelector('#entry-title');
|
||||
|
||||
// TODO readd this test when #3811 is fixed
|
||||
// // TODO readd this test when #3811 is fixed
|
||||
// // Change post to static page
|
||||
// casper.thenClick('.post-settings');
|
||||
// casper.waitForOpaque('.post-settings-menu.open');
|
||||
//
|
||||
|
||||
// casper.thenClick('.post-setting-static-page');
|
||||
//
|
||||
|
||||
// casper.thenTransitionAndWaitForScreenLoad('content', function onSuccess() {
|
||||
// casper.waitForSelector('.content-list-content li .entry-meta .status .page', function waitForSuccess() {
|
||||
// test.assertSelectorHasText('.content-list-content li .entry-meta .status .page', 'Page', 'status is Page');
|
||||
|
|
|
@ -5,33 +5,32 @@
|
|||
|
||||
CasperTest.begin('Ghost signup fails properly', 0, function suite(test) {
|
||||
/*jshint unused:false */
|
||||
/*
|
||||
casper.thenOpenAndWaitForPageLoad('signup', function then() {
|
||||
test.assertUrlMatch(/ghost\/signup\/$/, 'Landed on the correct URL');
|
||||
});
|
||||
|
||||
casper.then(function signupWithShortPassword() {
|
||||
casper.fillAndSave('#signup', {email: email, password: 'test'});
|
||||
});
|
||||
// casper.thenOpenAndWaitForPageLoad('signup', function then() {
|
||||
// test.assertUrlMatch(/ghost\/signup\/$/, 'Landed on the correct URL');
|
||||
// });
|
||||
|
||||
// should now throw a short password error
|
||||
casper.waitForSelector('.notification-error', function onSuccess() {
|
||||
test.assert(true, 'Got error notification');
|
||||
test.assertSelectorDoesntHaveText('.notification-error', '[object Object]');
|
||||
}, function onTimeout() {
|
||||
test.assert(false, 'No error notification :(');
|
||||
});
|
||||
// casper.then(function signupWithShortPassword() {
|
||||
// casper.fillAndSave('#signup', {email: email, password: 'test'});
|
||||
// });
|
||||
|
||||
casper.then(function signupWithLongPassword() {
|
||||
casper.fillAndSave('#signup', {email: email, password: 'testing1234'});
|
||||
});
|
||||
// // should now throw a short password error
|
||||
// casper.waitForSelector('.notification-error', function onSuccess() {
|
||||
// test.assert(true, 'Got error notification');
|
||||
// test.assertSelectorDoesntHaveText('.notification-error', '[object Object]');
|
||||
// }, function onTimeout() {
|
||||
// test.assert(false, 'No error notification :(');
|
||||
// });
|
||||
|
||||
// should now throw a 1 user only error
|
||||
casper.waitForSelector('.notification-error', function onSuccess() {
|
||||
test.assert(true, 'Got error notification');
|
||||
test.assertSelectorDoesntHaveText('.notification-error', '[object Object]');
|
||||
}, function onTimeout() {
|
||||
test.assert(false, 'No error notification :(');
|
||||
});
|
||||
*/
|
||||
// casper.then(function signupWithLongPassword() {
|
||||
// casper.fillAndSave('#signup', {email: email, password: 'testing1234'});
|
||||
// });
|
||||
|
||||
// // should now throw a 1 user only error
|
||||
// casper.waitForSelector('.notification-error', function onSuccess() {
|
||||
// test.assert(true, 'Got error notification');
|
||||
// test.assertSelectorDoesntHaveText('.notification-error', '[object Object]');
|
||||
// }, function onTimeout() {
|
||||
// test.assert(false, 'No error notification :(');
|
||||
// });
|
||||
}, true);
|
||||
|
|
|
@ -229,7 +229,7 @@ describe('Admin Routing', function () {
|
|||
// done();
|
||||
// });
|
||||
});
|
||||
//
|
||||
|
||||
// describe('Ghost Admin Forgot Password', function () {
|
||||
// before(function (done) {
|
||||
// // Create a user / do setup etc
|
||||
|
@ -244,7 +244,7 @@ describe('Admin Routing', function () {
|
|||
// })
|
||||
// .catch(done);
|
||||
// });
|
||||
//
|
||||
|
||||
// it('should respond with html for /ghost/forgotten/', function (done) {
|
||||
// request.get('/ghost/forgotten/')
|
||||
// .expect('Content-Type', /html/)
|
||||
|
@ -252,7 +252,7 @@ describe('Admin Routing', function () {
|
|||
// .expect(200)
|
||||
// .end(doEnd(done));
|
||||
// });
|
||||
//
|
||||
|
||||
// it('should respond 404 for /ghost/reset/', function (done) {
|
||||
// request.get('/ghost/reset/')
|
||||
// .expect('Cache-Control', testUtils.cacheRules['private'])
|
||||
|
@ -260,7 +260,7 @@ describe('Admin Routing', function () {
|
|||
// .expect(/Page Not Found/)
|
||||
// .end(doEnd(done));
|
||||
// });
|
||||
//
|
||||
|
||||
// it('should redirect /ghost/reset/*/', function (done) {
|
||||
// request.get('/ghost/reset/athing/')
|
||||
// .expect('Location', /ghost\/forgotten/)
|
||||
|
|
|
@ -99,46 +99,46 @@ describe('Authentication API', function () {
|
|||
});
|
||||
|
||||
// describe('Authentication', function () {
|
||||
//
|
||||
|
||||
// describe('Setup not completed', function () {
|
||||
//
|
||||
|
||||
// beforeEach(testUtils.setup());
|
||||
//
|
||||
|
||||
// it('should not allow an invitation to be accepted', function (done) {
|
||||
// AuthAPI.acceptInvitation().then(function () {
|
||||
// done(new Error('Invitation was allowed to be accepted'));
|
||||
// }).catch(function (err) {
|
||||
// should.exist(err);
|
||||
//
|
||||
|
||||
// err.name.should.equal('NoPermissionError');
|
||||
// err.code.should.equal(403);
|
||||
//
|
||||
|
||||
// done();
|
||||
// });
|
||||
// });
|
||||
//
|
||||
|
||||
// it('should not generate a password reset token', function (done) {
|
||||
// AuthAPI.generateResetToken().then(function () {
|
||||
// done(new Error('Reset token was generated'));
|
||||
// }).catch(function (err) {
|
||||
// should.exist(err);
|
||||
//
|
||||
|
||||
// err.name.should.equal('NoPermissionError');
|
||||
// err.code.should.equal(403);
|
||||
//
|
||||
|
||||
// done();
|
||||
// });
|
||||
// });
|
||||
//
|
||||
|
||||
// it('should not allow a password reset', function (done) {
|
||||
// AuthAPI.resetPassword().then(function () {
|
||||
// done(new Error('Password was reset'));
|
||||
// }).catch(function (err) {
|
||||
// should.exist(err);
|
||||
//
|
||||
|
||||
// err.name.should.equal('NoPermissionError');
|
||||
// err.code.should.equal(403);
|
||||
//
|
||||
|
||||
// done();
|
||||
// });
|
||||
// });
|
||||
|
|
|
@ -88,19 +88,19 @@ describe('Permission Model', function () {
|
|||
|
||||
// it('can add user to role', function (done) {
|
||||
// var existingUserRoles;
|
||||
//
|
||||
|
||||
// Models.User.findOne({id: 1}, { withRelated: ['roles'] }).then(function (foundUser) {
|
||||
// var testRole = new Models.Role({
|
||||
// name: 'testrole1',
|
||||
// description: 'testrole1 description'
|
||||
// });
|
||||
//
|
||||
|
||||
// should.exist(foundUser);
|
||||
//
|
||||
|
||||
// should.exist(foundUser.roles());
|
||||
//
|
||||
|
||||
// existingUserRoles = foundUser.related('roles').length;
|
||||
//
|
||||
|
||||
// return testRole.save(null, context).then(function () {
|
||||
// return foundUser.roles().attach(testRole);
|
||||
// });
|
||||
|
@ -108,13 +108,13 @@ describe('Permission Model', function () {
|
|||
// return Models.User.findOne({id: 1}, { withRelated: ['roles'] });
|
||||
// }).then(function (updatedUser) {
|
||||
// should.exist(updatedUser);
|
||||
//
|
||||
|
||||
// updatedUser.related('roles').length.should.equal(existingUserRoles + 1);
|
||||
//
|
||||
|
||||
// done();
|
||||
// }).catch(done);
|
||||
// });
|
||||
//
|
||||
|
||||
// it('can add user permissions', function (done) {
|
||||
// Models.User.findOne({id: 1}, { withRelated: ['permissions']}).then(function (testUser) {
|
||||
// var testPermission = new Models.Permission({
|
||||
|
@ -122,9 +122,9 @@ describe('Permission Model', function () {
|
|||
// action_type: 'edit',
|
||||
// object_type: 'post'
|
||||
// });
|
||||
//
|
||||
|
||||
// testUser.related('permissions').length.should.equal(0);
|
||||
//
|
||||
|
||||
// return testPermission.save(null, context).then(function () {
|
||||
// return testUser.permissions().attach(testPermission);
|
||||
// });
|
||||
|
@ -132,19 +132,19 @@ describe('Permission Model', function () {
|
|||
// return Models.User.findOne({id: 1}, { include: ['permissions']});
|
||||
// }).then(function (updatedUser) {
|
||||
// should.exist(updatedUser);
|
||||
//
|
||||
|
||||
// updatedUser.related('permissions').length.should.equal(1);
|
||||
//
|
||||
|
||||
// done();
|
||||
// }).catch(done);
|
||||
// });
|
||||
//
|
||||
|
||||
// it('can add role permissions', function (done) {
|
||||
// var testRole = new Models.Role({
|
||||
// name: 'test2',
|
||||
// description: 'test2 description'
|
||||
// });
|
||||
//
|
||||
|
||||
// testRole.save(null, context)
|
||||
// .then(function () {
|
||||
// return testRole.load('permissions');
|
||||
|
@ -155,9 +155,9 @@ describe('Permission Model', function () {
|
|||
// action_type: 'edit',
|
||||
// object_type: 'post'
|
||||
// });
|
||||
//
|
||||
|
||||
// testRole.related('permissions').length.should.equal(0);
|
||||
//
|
||||
|
||||
// return rolePermission.save(null, context).then(function () {
|
||||
// return testRole.permissions().attach(rolePermission);
|
||||
// });
|
||||
|
@ -167,9 +167,9 @@ describe('Permission Model', function () {
|
|||
// })
|
||||
// .then(function (updatedRole) {
|
||||
// should.exist(updatedRole);
|
||||
//
|
||||
|
||||
// updatedRole.related('permissions').length.should.equal(1);
|
||||
//
|
||||
|
||||
// done();
|
||||
// }).catch(done);
|
||||
// });
|
||||
|
|
|
@ -51,26 +51,26 @@ describe('Permissions', function () {
|
|||
// var fakePage = {
|
||||
// id: 1
|
||||
// };
|
||||
//
|
||||
|
||||
// permissions.init()
|
||||
// .then(function () {
|
||||
// var canThisResult = permissions.canThis({id: 1});
|
||||
//
|
||||
|
||||
// should.exist(canThisResult.edit);
|
||||
// should.exist(canThisResult.edit.post);
|
||||
//
|
||||
|
||||
// return canThisResult.edit.page(fakePage);
|
||||
// })
|
||||
// .then(function () {
|
||||
// done(new Error('was able to edit post without permission'));
|
||||
// }).catch(done);
|
||||
// });
|
||||
// ////
|
||||
|
||||
// it('allows edit post with permission', function (done) {
|
||||
// var fakePost = {
|
||||
// id: '1'
|
||||
// };
|
||||
//
|
||||
|
||||
// permissions.init()
|
||||
// .then(function () {
|
||||
// return Models.User.findOne({id: 1});
|
||||
|
@ -81,7 +81,7 @@ describe('Permissions', function () {
|
|||
// action_type: 'edit',
|
||||
// object_type: 'post'
|
||||
// });
|
||||
//
|
||||
|
||||
// return newPerm.save(null, context).then(function () {
|
||||
// return foundUser.permissions().attach(newPerm);
|
||||
// });
|
||||
|
@ -90,66 +90,66 @@ describe('Permissions', function () {
|
|||
// return Models.User.findOne({id: 1}, { withRelated: ['permissions']});
|
||||
// })
|
||||
// .then(function (updatedUser) {
|
||||
//
|
||||
|
||||
// // TODO: Verify updatedUser.related('permissions') has the permission?
|
||||
// var canThisResult = permissions.canThis(updatedUser.id);
|
||||
//
|
||||
|
||||
// should.exist(canThisResult.edit);
|
||||
// should.exist(canThisResult.edit.post);
|
||||
//
|
||||
|
||||
// return canThisResult.edit.post(fakePost);
|
||||
// })
|
||||
// .then(function () {
|
||||
// done();
|
||||
// }).catch(done);
|
||||
// });
|
||||
//
|
||||
|
||||
// it('can use permissible function on Model to allow something', function (done) {
|
||||
// var testUser,
|
||||
// permissibleStub = sandbox.stub(Models.Post, 'permissible', function () {
|
||||
// return Promise.resolve();
|
||||
// });
|
||||
//
|
||||
|
||||
// testUtils.insertAuthorUser()
|
||||
// .then(function () {
|
||||
// return Models.User.findAll();
|
||||
// })
|
||||
// .then(function (foundUser) {
|
||||
// testUser = foundUser.models[1];
|
||||
//
|
||||
|
||||
// return permissions.canThis({user: testUser.id}).edit.post(123);
|
||||
// })
|
||||
// .then(function () {
|
||||
// permissibleStub.restore();
|
||||
// permissibleStub.calledWith(123, { user: testUser.id, app: null, internal: false })
|
||||
// .should.equal(true);
|
||||
//
|
||||
|
||||
// done();
|
||||
// })
|
||||
// .catch(function () {
|
||||
// permissibleStub.restore();
|
||||
//
|
||||
|
||||
// done(new Error('did not allow testUser'));
|
||||
// });
|
||||
// });
|
||||
//
|
||||
|
||||
// it('can use permissible function on Model to forbid something', function (done) {
|
||||
// var testUser,
|
||||
// permissibleStub = sandbox.stub(Models.Post, 'permissible', function () {
|
||||
// return Promise.reject();
|
||||
// });
|
||||
//
|
||||
|
||||
// testUtils.insertAuthorUser()
|
||||
// .then(function () {
|
||||
// return Models.User.findAll();
|
||||
// })
|
||||
// .then(function (foundUser) {
|
||||
// testUser = foundUser.models[1];
|
||||
//
|
||||
|
||||
// return permissions.canThis({user: testUser.id}).edit.post(123);
|
||||
// })
|
||||
// .then(function () {
|
||||
//
|
||||
|
||||
// permissibleStub.restore();
|
||||
// done(new Error('Allowed testUser to edit post'));
|
||||
// })
|
||||
|
@ -160,29 +160,29 @@ describe('Permissions', function () {
|
|||
// done();
|
||||
// });
|
||||
// });
|
||||
//
|
||||
|
||||
// it('can get effective user permissions', function (done) {
|
||||
// effectivePerms.user(1).then(function (effectivePermissions) {
|
||||
// should.exist(effectivePermissions);
|
||||
//
|
||||
|
||||
// effectivePermissions.length.should.be.above(0);
|
||||
//
|
||||
|
||||
// done();
|
||||
// }).catch(done);
|
||||
// });
|
||||
//
|
||||
|
||||
// it('can check an apps effective permissions', function (done) {
|
||||
// effectivePerms.app('Kudos')
|
||||
// .then(function (effectivePermissions) {
|
||||
// should.exist(effectivePermissions);
|
||||
//
|
||||
|
||||
// effectivePermissions.length.should.be.above(0);
|
||||
//
|
||||
|
||||
// done();
|
||||
// })
|
||||
// .catch(done);
|
||||
// });
|
||||
//
|
||||
|
||||
// it('does not allow an app to edit a post without permission', function (done) {
|
||||
// // Change the author of the post so the author override doesn't affect the test
|
||||
// Models.Post.edit({'author_id': 2}, _.extend(context, {id: 1}))
|
||||
|
@ -195,7 +195,7 @@ describe('Permissions', function () {
|
|||
// action_type: 'edit',
|
||||
// object_type: 'post'
|
||||
// });
|
||||
//
|
||||
|
||||
// return newPerm.save(null, context).then(function () {
|
||||
// return foundUser.permissions().attach(newPerm).then(function () {
|
||||
// return Promise.all([updatedPost, foundUser]);
|
||||
|
@ -206,7 +206,7 @@ describe('Permissions', function () {
|
|||
// .then(function (results) {
|
||||
// var updatedPost = results[0],
|
||||
// updatedUser = results[1];
|
||||
//
|
||||
|
||||
// return permissions.canThis({ user: updatedUser.id })
|
||||
// .edit
|
||||
// .post(updatedPost.id)
|
||||
|
@ -221,7 +221,7 @@ describe('Permissions', function () {
|
|||
// .then(function (results) {
|
||||
// var updatedPost = results[0],
|
||||
// updatedUser = results[1];
|
||||
//
|
||||
|
||||
// // Confirm app cannot edit it.
|
||||
// return permissions.canThis({ app: 'Hemingway', user: updatedUser.id })
|
||||
// .edit
|
||||
|
@ -231,7 +231,7 @@ describe('Permissions', function () {
|
|||
// }).catch(done);
|
||||
// }).catch(done);
|
||||
// });
|
||||
//
|
||||
|
||||
// it('allows an app to edit a post with permission', function (done) {
|
||||
// permissions.canThis({ app: 'Kudos', user: 1 })
|
||||
// .edit
|
||||
|
@ -243,7 +243,7 @@ describe('Permissions', function () {
|
|||
// done(new Error('Did not allow an edit of post 1'));
|
||||
// });
|
||||
// });
|
||||
//
|
||||
|
||||
// it('checks for null context passed and rejects', function (done) {
|
||||
// permissions.canThis(undefined)
|
||||
// .edit
|
||||
|
@ -253,7 +253,7 @@ describe('Permissions', function () {
|
|||
// })
|
||||
// .catch(done);
|
||||
// });
|
||||
//
|
||||
|
||||
// it('allows \'internal\' to be passed for internal requests', function (done) {
|
||||
// // Using tag here because post implements the custom permissible interface
|
||||
// permissions.canThis('internal')
|
||||
|
@ -266,7 +266,7 @@ describe('Permissions', function () {
|
|||
// done(new Error('Should allow editing post with "internal"'));
|
||||
// });
|
||||
// });
|
||||
//
|
||||
|
||||
// it('allows { internal: true } to be passed for internal requests', function (done) {
|
||||
// // Using tag here because post implements the custom permissible interface
|
||||
// permissions.canThis({internal: true})
|
||||
|
|
|
@ -45,7 +45,7 @@ describe('Showdown client side converter', function () {
|
|||
// it('should not create italic words between lines', function () {
|
||||
// var testPhrase = {input: 'foo_bar\nbar_foo', output: /^<p>foo_bar <br \/>\nbar_foo<\/p>$/},
|
||||
// processedMarkup = converter.makeHtml(testPhrase.input);
|
||||
//
|
||||
|
||||
// processedMarkup.should.match(testPhrase.output);
|
||||
// });
|
||||
|
||||
|
@ -624,10 +624,10 @@ describe('Showdown client side converter', function () {
|
|||
// input: 'Hello world\nIt's a fine day\nout',
|
||||
// output: /^<p>Hello world <br \/>\nIt’s a fine day <br \/>\nout<\/p>$/}
|
||||
// ];
|
||||
//
|
||||
|
||||
// testPhrases.forEach(function (testPhrase) {
|
||||
// processedMarkup = converter.makeHtml(testPhrase.input);
|
||||
// processedMarkup.should.match(testPhrase.output);
|
||||
// });
|
||||
// })
|
||||
// });
|
||||
});
|
||||
|
|
|
@ -84,7 +84,7 @@
|
|||
"grunt-contrib-watch": "~0.6.1",
|
||||
"grunt-docker": "~0.0.8",
|
||||
"grunt-express-server": "~0.4.19",
|
||||
"grunt-jscs": "~1.2.0",
|
||||
"grunt-jscs": "~1.8.0",
|
||||
"grunt-mocha-cli": "~1.11.0",
|
||||
"grunt-mocha-istanbul": "2.4.0",
|
||||
"grunt-shell": "~1.1.1",
|
||||
|
|
Loading…
Add table
Reference in a new issue