mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-28 22:43:30 +03:00
Merge pull request #6690 from kevinansfield/ember-suave-2-0
deps: ember-suave@2.0.1
This commit is contained in:
commit
d542ae86df
@ -4,7 +4,7 @@ const {HistoryLocation} = Ember;
|
||||
|
||||
let trailingHistory = HistoryLocation.extend({
|
||||
formatURL() {
|
||||
return this._super.apply(this, arguments).replace(/\/?$/, '/');
|
||||
return this._super(...arguments).replace(/\/?$/, '/');
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -10,7 +10,7 @@ export default Ember.Mixin.create({
|
||||
let router = this.get('router');
|
||||
let params = [];
|
||||
|
||||
for (const key of Object.keys(routeInfo.params)) {
|
||||
for (let key of Object.keys(routeInfo.params)) {
|
||||
params.push(routeInfo.params[key]);
|
||||
}
|
||||
|
||||
|
@ -59,7 +59,7 @@ export default Model.extend(ValidationEngine, {
|
||||
return ['invited', 'invited-pending'].indexOf(this.get('status')) > -1;
|
||||
}),
|
||||
|
||||
pending: equal('status', 'invited-pending').property('status'),
|
||||
pending: equal('status', 'invited-pending'),
|
||||
|
||||
passwordValidationErrors: computed('password', 'newPassword', 'ne2Password', function () {
|
||||
let validationErrors = [];
|
||||
|
@ -26,7 +26,7 @@ export default function () {
|
||||
}
|
||||
|
||||
if (isArray(titleToken)) {
|
||||
tokens.unshift.apply(this, titleToken);
|
||||
tokens.unshift(...titleToken);
|
||||
} else if (titleToken) {
|
||||
tokens.unshift(titleToken);
|
||||
}
|
||||
|
@ -47,7 +47,7 @@
|
||||
"ember-simple-auth": "1.0.1",
|
||||
"ember-sinon": "0.5.0",
|
||||
"ember-sortable": "1.7.0",
|
||||
"ember-suave": "1.2.3",
|
||||
"ember-suave": "2.0.1",
|
||||
"ember-watson": "0.7.0",
|
||||
"fs-extra": "0.16.3",
|
||||
"glob": "^4.0.5",
|
||||
|
@ -34,8 +34,8 @@ describe('Acceptance: Team', function () {
|
||||
});
|
||||
|
||||
it('redirects correctly when authenticated as author', function () {
|
||||
const role = server.create('role', {name: 'Author'});
|
||||
const user = server.create('user', {roles: [role], slug: 'test-user'});
|
||||
let role = server.create('role', {name: 'Author'});
|
||||
let user = server.create('user', {roles: [role], slug: 'test-user'});
|
||||
|
||||
server.create('user', {slug: 'no-access'});
|
||||
|
||||
@ -48,8 +48,8 @@ describe('Acceptance: Team', function () {
|
||||
});
|
||||
|
||||
it('redirects correctly when authenticated as editor', function () {
|
||||
const role = server.create('role', {name: 'Editor'});
|
||||
const user = server.create('user', {roles: [role], slug: 'test-user'});
|
||||
let role = server.create('role', {name: 'Editor'});
|
||||
let user = server.create('user', {roles: [role], slug: 'test-user'});
|
||||
|
||||
server.create('user', {slug: 'no-access'});
|
||||
|
||||
@ -63,8 +63,8 @@ describe('Acceptance: Team', function () {
|
||||
|
||||
describe('when logged in', function () {
|
||||
beforeEach(function () {
|
||||
const role = server.create('role', {name: 'Admininstrator'});
|
||||
const user = server.create('user', {roles: [role]});
|
||||
let role = server.create('role', {name: 'Admininstrator'});
|
||||
let user = server.create('user', {roles: [role]});
|
||||
|
||||
server.loadFixtures();
|
||||
|
||||
@ -72,8 +72,8 @@ describe('Acceptance: Team', function () {
|
||||
});
|
||||
|
||||
it('it renders and navigates correctly', function () {
|
||||
const user1 = server.create('user');
|
||||
const user2 = server.create('user');
|
||||
let user1 = server.create('user');
|
||||
let user2 = server.create('user');
|
||||
|
||||
visit('/team');
|
||||
|
||||
|
@ -8,13 +8,13 @@ export default function (name, options = {}) {
|
||||
this.application = startApp();
|
||||
|
||||
if (options.beforeEach) {
|
||||
options.beforeEach.apply(this, arguments);
|
||||
options.beforeEach(...arguments);
|
||||
}
|
||||
},
|
||||
|
||||
afterEach() {
|
||||
if (options.afterEach) {
|
||||
options.afterEach.apply(this, arguments);
|
||||
options.afterEach(...arguments);
|
||||
}
|
||||
|
||||
destroyApp(this.application);
|
||||
|
@ -15,7 +15,7 @@ describeModule(
|
||||
|
||||
function () {
|
||||
it('isDatedPermalinks should be correct', function () {
|
||||
const controller = this.subject({
|
||||
let controller = this.subject({
|
||||
model: Ember.Object.create({
|
||||
permalinks: '/:year/:month/:day/:slug/'
|
||||
})
|
||||
@ -31,7 +31,7 @@ describeModule(
|
||||
});
|
||||
|
||||
it('setting isDatedPermalinks should switch between dated and slug', function () {
|
||||
const controller = this.subject({
|
||||
let controller = this.subject({
|
||||
model: Ember.Object.create({
|
||||
permalinks: '/:year/:month/:day/:slug/'
|
||||
})
|
||||
|
@ -11,7 +11,7 @@ import {
|
||||
describe('Unit: Helper: is-equal', function () {
|
||||
// Replace this with your real tests.
|
||||
it('works', function () {
|
||||
const result = isEqual([42, 42]);
|
||||
let result = isEqual([42, 42]);
|
||||
|
||||
expect(result).to.be.ok;
|
||||
});
|
||||
|
@ -8,7 +8,7 @@ const {run} = Ember;
|
||||
|
||||
describeModel('role', 'Unit: Model: role', function () {
|
||||
it('provides a lowercase version of the name', function () {
|
||||
const model = this.subject({
|
||||
let model = this.subject({
|
||||
name: 'Author'
|
||||
});
|
||||
|
||||
|
@ -17,7 +17,7 @@ describeModule(
|
||||
function () {
|
||||
// Replace this with your real tests.
|
||||
it('exists', function () {
|
||||
const service = this.subject();
|
||||
let service = this.subject();
|
||||
expect(service).to.be.ok;
|
||||
});
|
||||
|
||||
@ -26,7 +26,7 @@ describeModule(
|
||||
.attr('content', '23e435234423')
|
||||
.appendTo('head');
|
||||
|
||||
const service = this.subject();
|
||||
let service = this.subject();
|
||||
|
||||
expect(service.get('clientSecret')).to.equal('23e435234423');
|
||||
});
|
||||
|
@ -25,7 +25,7 @@ describeModule(
|
||||
});
|
||||
|
||||
it('filters alerts/notifications', function () {
|
||||
const notifications = this.subject();
|
||||
let notifications = this.subject();
|
||||
|
||||
// wrapped in run-loop to enure alerts/notifications CPs are updated
|
||||
run(() => {
|
||||
@ -41,7 +41,7 @@ describeModule(
|
||||
});
|
||||
|
||||
it('#handleNotification deals with DS.Notification notifications', function () {
|
||||
const notifications = this.subject();
|
||||
let notifications = this.subject();
|
||||
let notification = Ember.Object.create({message: '<h1>Test</h1>', status: 'alert'});
|
||||
|
||||
notification.toJSON = function () {};
|
||||
@ -55,7 +55,7 @@ describeModule(
|
||||
});
|
||||
|
||||
it('#handleNotification defaults to notification if no status supplied', function () {
|
||||
const notifications = this.subject();
|
||||
let notifications = this.subject();
|
||||
|
||||
notifications.handleNotification({message: 'Test'}, false);
|
||||
|
||||
@ -64,7 +64,7 @@ describeModule(
|
||||
});
|
||||
|
||||
it('#showAlert adds POJO alerts', function () {
|
||||
const notifications = this.subject();
|
||||
let notifications = this.subject();
|
||||
|
||||
run(() => {
|
||||
notifications.showAlert('Test Alert', {type: 'error'});
|
||||
@ -75,7 +75,7 @@ describeModule(
|
||||
});
|
||||
|
||||
it('#showAlert adds delayed notifications', function () {
|
||||
const notifications = this.subject();
|
||||
let notifications = this.subject();
|
||||
|
||||
run(() => {
|
||||
notifications.showNotification('Test Alert', {type: 'error', delayed: true});
|
||||
@ -89,7 +89,7 @@ describeModule(
|
||||
// we split on the second period and treat the resulting base as
|
||||
// the key for duplicate checking
|
||||
it('#showAlert clears duplicates', function () {
|
||||
const notifications = this.subject();
|
||||
let notifications = this.subject();
|
||||
|
||||
run(() => {
|
||||
notifications.showAlert('Kept');
|
||||
@ -107,7 +107,7 @@ describeModule(
|
||||
});
|
||||
|
||||
it('#showNotification adds POJO notifications', function () {
|
||||
const notifications = this.subject();
|
||||
let notifications = this.subject();
|
||||
|
||||
run(() => {
|
||||
notifications.showNotification('Test Notification', {type: 'success'});
|
||||
@ -118,7 +118,7 @@ describeModule(
|
||||
});
|
||||
|
||||
it('#showNotification adds delayed notifications', function () {
|
||||
const notifications = this.subject();
|
||||
let notifications = this.subject();
|
||||
|
||||
run(() => {
|
||||
notifications.showNotification('Test Notification', {delayed: true});
|
||||
@ -129,7 +129,7 @@ describeModule(
|
||||
});
|
||||
|
||||
it('#showNotification clears existing notifications', function () {
|
||||
const notifications = this.subject();
|
||||
let notifications = this.subject();
|
||||
|
||||
run(() => {
|
||||
notifications.showNotification('First');
|
||||
@ -142,7 +142,7 @@ describeModule(
|
||||
});
|
||||
|
||||
it('#showNotification keeps existing notifications if doNotCloseNotifications option passed', function () {
|
||||
const notifications = this.subject();
|
||||
let notifications = this.subject();
|
||||
|
||||
run(() => {
|
||||
notifications.showNotification('First');
|
||||
@ -154,7 +154,7 @@ describeModule(
|
||||
|
||||
// TODO: review whether this can be removed once it's no longer used by validations
|
||||
it('#showErrors adds multiple notifications', function () {
|
||||
const notifications = this.subject();
|
||||
let notifications = this.subject();
|
||||
|
||||
run(() => {
|
||||
notifications.showErrors([
|
||||
@ -170,8 +170,8 @@ describeModule(
|
||||
});
|
||||
|
||||
it('#showAPIError adds single json response error', function () {
|
||||
const notifications = this.subject();
|
||||
const error = new AjaxError('Single error');
|
||||
let notifications = this.subject();
|
||||
let error = new AjaxError('Single error');
|
||||
|
||||
run(() => {
|
||||
notifications.showAPIError(error);
|
||||
@ -186,8 +186,8 @@ describeModule(
|
||||
|
||||
// used to display validation errors returned from the server
|
||||
it('#showAPIError adds multiple json response errors', function () {
|
||||
const notifications = this.subject();
|
||||
const error = new AjaxError(['First error', 'Second error']);
|
||||
let notifications = this.subject();
|
||||
let error = new AjaxError(['First error', 'Second error']);
|
||||
|
||||
run(() => {
|
||||
notifications.showAPIError(error);
|
||||
@ -200,8 +200,8 @@ describeModule(
|
||||
});
|
||||
|
||||
it('#showAPIError displays default error text if response has no error/message', function () {
|
||||
const notifications = this.subject();
|
||||
const resp = false;
|
||||
let notifications = this.subject();
|
||||
let resp = false;
|
||||
|
||||
run(() => { notifications.showAPIError(resp); });
|
||||
|
||||
@ -220,7 +220,7 @@ describeModule(
|
||||
});
|
||||
|
||||
it('#showAPIError sets correct key when passed a base key', function () {
|
||||
const notifications = this.subject();
|
||||
let notifications = this.subject();
|
||||
|
||||
run(() => {
|
||||
notifications.showAPIError('Test', {key: 'test.alert'});
|
||||
@ -230,7 +230,7 @@ describeModule(
|
||||
});
|
||||
|
||||
it('#showAPIError sets correct key when not passed a key', function () {
|
||||
const notifications = this.subject();
|
||||
let notifications = this.subject();
|
||||
|
||||
run(() => {
|
||||
notifications.showAPIError('Test');
|
||||
@ -240,8 +240,8 @@ describeModule(
|
||||
});
|
||||
|
||||
it('#showAPIError parses errors from ember-ajax correctly', function () {
|
||||
const notifications = this.subject();
|
||||
const error = new InvalidError('Test Error');
|
||||
let notifications = this.subject();
|
||||
let error = new InvalidError('Test Error');
|
||||
|
||||
run(() => {
|
||||
notifications.showAPIError(error);
|
||||
@ -255,7 +255,7 @@ describeModule(
|
||||
});
|
||||
|
||||
it('#displayDelayed moves delayed notifications into content', function () {
|
||||
const notifications = this.subject();
|
||||
let notifications = this.subject();
|
||||
|
||||
run(() => {
|
||||
notifications.showNotification('First', {delayed: true});
|
||||
@ -272,8 +272,8 @@ describeModule(
|
||||
});
|
||||
|
||||
it('#closeNotification removes POJO notifications', function () {
|
||||
const notification = {message: 'Close test', status: 'notification'};
|
||||
const notifications = this.subject();
|
||||
let notification = {message: 'Close test', status: 'notification'};
|
||||
let notifications = this.subject();
|
||||
|
||||
run(() => {
|
||||
notifications.handleNotification(notification);
|
||||
@ -291,8 +291,8 @@ describeModule(
|
||||
});
|
||||
|
||||
it('#closeNotification removes and deletes DS.Notification records', function () {
|
||||
const notification = Ember.Object.create({message: 'Close test', status: 'alert'});
|
||||
const notifications = this.subject();
|
||||
let notification = Ember.Object.create({message: 'Close test', status: 'alert'});
|
||||
let notifications = this.subject();
|
||||
|
||||
notification.toJSON = function () {};
|
||||
notification.deleteRecord = function () {};
|
||||
@ -319,7 +319,7 @@ describeModule(
|
||||
});
|
||||
|
||||
it('#closeNotifications only removes notifications', function () {
|
||||
const notifications = this.subject();
|
||||
let notifications = this.subject();
|
||||
|
||||
run(() => {
|
||||
notifications.showAlert('First alert');
|
||||
@ -337,7 +337,7 @@ describeModule(
|
||||
});
|
||||
|
||||
it('#closeNotifications only closes notifications with specified key', function () {
|
||||
const notifications = this.subject();
|
||||
let notifications = this.subject();
|
||||
|
||||
run(() => {
|
||||
notifications.showAlert('First alert');
|
||||
@ -359,8 +359,8 @@ describeModule(
|
||||
});
|
||||
|
||||
it('#clearAll removes everything without deletion', function () {
|
||||
const notifications = this.subject();
|
||||
const notificationModel = Ember.Object.create({message: 'model'});
|
||||
let notifications = this.subject();
|
||||
let notificationModel = Ember.Object.create({message: 'model'});
|
||||
|
||||
notificationModel.toJSON = function () {};
|
||||
notificationModel.deleteRecord = function () {};
|
||||
@ -385,7 +385,7 @@ describeModule(
|
||||
});
|
||||
|
||||
it('#closeAlerts only removes alerts', function () {
|
||||
const notifications = this.subject();
|
||||
let notifications = this.subject();
|
||||
|
||||
notifications.showNotification('First notification');
|
||||
notifications.showAlert('First alert');
|
||||
@ -400,7 +400,7 @@ describeModule(
|
||||
});
|
||||
|
||||
it('#closeAlerts closes only alerts with specified key', function () {
|
||||
const notifications = this.subject();
|
||||
let notifications = this.subject();
|
||||
|
||||
notifications.showNotification('First notification');
|
||||
notifications.showAlert('First alert', {key: 'test.close'});
|
||||
|
@ -2,7 +2,7 @@ import ghostPaths from 'ghost/utils/ghost-paths';
|
||||
|
||||
describe('Unit: Util: ghost-paths', function () {
|
||||
describe('join', function () {
|
||||
const {join} = ghostPaths().url;
|
||||
let {join} = ghostPaths().url;
|
||||
|
||||
it('should join two or more paths, normalizing slashes', function () {
|
||||
let path;
|
||||
|
@ -29,8 +29,8 @@ const Tag = Ember.Object.extend(ValidationEngine, {
|
||||
|
||||
describe('Unit: Validator: tag-settings', function () {
|
||||
it('validates all fields by default', function () {
|
||||
const tag = Tag.create({});
|
||||
const properties = tag.get('validators.tag.properties');
|
||||
let tag = Tag.create({});
|
||||
let properties = tag.get('validators.tag.properties');
|
||||
|
||||
// TODO: This is checking implementation details rather than expected
|
||||
// behaviour. Replace once we have consistent behaviour (see below)
|
||||
@ -56,7 +56,7 @@ describe('Unit: Validator: tag-settings', function () {
|
||||
|
||||
it('passes with valid name', function () {
|
||||
// longest valid name
|
||||
const tag = Tag.create({name: (new Array(151).join('x'))});
|
||||
let tag = Tag.create({name: (new Array(151).join('x'))});
|
||||
let passed = false;
|
||||
|
||||
expect(tag.get('name').length, 'name length').to.equal(150);
|
||||
@ -72,7 +72,7 @@ describe('Unit: Validator: tag-settings', function () {
|
||||
});
|
||||
|
||||
it('validates name presence', function () {
|
||||
const tag = Tag.create();
|
||||
let tag = Tag.create();
|
||||
let passed = false;
|
||||
let nameErrors;
|
||||
|
||||
@ -99,7 +99,7 @@ describe('Unit: Validator: tag-settings', function () {
|
||||
});
|
||||
|
||||
it('validates names starting with a comma', function () {
|
||||
const tag = Tag.create({name: ',test'});
|
||||
let tag = Tag.create({name: ',test'});
|
||||
let passed = false;
|
||||
let nameErrors;
|
||||
|
||||
@ -119,7 +119,7 @@ describe('Unit: Validator: tag-settings', function () {
|
||||
|
||||
it('validates name length', function () {
|
||||
// shortest invalid name
|
||||
const tag = Tag.create({name: (new Array(152).join('x'))});
|
||||
let tag = Tag.create({name: (new Array(152).join('x'))});
|
||||
let passed = false;
|
||||
let nameErrors;
|
||||
|
||||
@ -141,7 +141,7 @@ describe('Unit: Validator: tag-settings', function () {
|
||||
|
||||
it('passes with valid slug', function () {
|
||||
// longest valid slug
|
||||
const tag = Tag.create({slug: (new Array(151).join('x'))});
|
||||
let tag = Tag.create({slug: (new Array(151).join('x'))});
|
||||
let passed = false;
|
||||
|
||||
expect(tag.get('slug').length, 'slug length').to.equal(150);
|
||||
@ -158,7 +158,7 @@ describe('Unit: Validator: tag-settings', function () {
|
||||
|
||||
it('validates slug length', function () {
|
||||
// shortest invalid slug
|
||||
const tag = Tag.create({slug: (new Array(152).join('x'))});
|
||||
let tag = Tag.create({slug: (new Array(152).join('x'))});
|
||||
let passed = false;
|
||||
let slugErrors;
|
||||
|
||||
@ -180,7 +180,7 @@ describe('Unit: Validator: tag-settings', function () {
|
||||
|
||||
it('passes with a valid description', function () {
|
||||
// longest valid description
|
||||
const tag = Tag.create({description: (new Array(201).join('x'))});
|
||||
let tag = Tag.create({description: (new Array(201).join('x'))});
|
||||
let passed = false;
|
||||
|
||||
expect(tag.get('description').length, 'description length').to.equal(200);
|
||||
@ -197,7 +197,7 @@ describe('Unit: Validator: tag-settings', function () {
|
||||
|
||||
it('validates description length', function () {
|
||||
// shortest invalid description
|
||||
const tag = Tag.create({description: (new Array(202).join('x'))});
|
||||
let tag = Tag.create({description: (new Array(202).join('x'))});
|
||||
let passed = false;
|
||||
let errors;
|
||||
|
||||
@ -227,7 +227,7 @@ describe('Unit: Validator: tag-settings', function () {
|
||||
// model/validator respectively - this should be standardised
|
||||
it('passes with a valid metaTitle', function () {
|
||||
// longest valid metaTitle
|
||||
const tag = Tag.create({metaTitle: (new Array(151).join('x'))});
|
||||
let tag = Tag.create({metaTitle: (new Array(151).join('x'))});
|
||||
let passed = false;
|
||||
|
||||
expect(tag.get('metaTitle').length, 'metaTitle length').to.equal(150);
|
||||
@ -244,7 +244,7 @@ describe('Unit: Validator: tag-settings', function () {
|
||||
|
||||
it('validates metaTitle length', function () {
|
||||
// shortest invalid metaTitle
|
||||
const tag = Tag.create({metaTitle: (new Array(152).join('x'))});
|
||||
let tag = Tag.create({metaTitle: (new Array(152).join('x'))});
|
||||
let passed = false;
|
||||
let errors;
|
||||
|
||||
@ -268,7 +268,7 @@ describe('Unit: Validator: tag-settings', function () {
|
||||
// the model/validator respectively - this should be standardised
|
||||
it('passes with a valid metaDescription', function () {
|
||||
// longest valid description
|
||||
const tag = Tag.create({metaDescription: (new Array(201).join('x'))});
|
||||
let tag = Tag.create({metaDescription: (new Array(201).join('x'))});
|
||||
let passed = false;
|
||||
|
||||
expect(tag.get('metaDescription').length, 'metaDescription length').to.equal(200);
|
||||
@ -285,7 +285,7 @@ describe('Unit: Validator: tag-settings', function () {
|
||||
|
||||
it('validates metaDescription length', function () {
|
||||
// shortest invalid metaDescription
|
||||
const tag = Tag.create({metaDescription: (new Array(202).join('x'))});
|
||||
let tag = Tag.create({metaDescription: (new Array(202).join('x'))});
|
||||
let passed = false;
|
||||
let errors;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user