0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -05:00
ghost/core/client/tests/unit/mixins/validation-engine-test.js
Kevin Ansfield 73ea9f52f0 Fix auth regressions after ESA 1.0 upgrade
refs #6039, closes #6047, closes #6048

- delete old/unused fixtures file
- add failing tests for #6047 & #6048
- redirect to sign-in if we get a 401 when making an API request
- fix incorrect `this.notifications` call in tag controller
- raise `authorizationFailed` action in application route's `sessionInvalidated` hook so that it can be handled by leaf routes (fixes re-auth modal display)
- close "saving failed" alert when successfully re-authenticated
- adds a "window-proxy" util so that we can override `window.*` operations in tests
- fix `gh-selectize` attempting to register event handlers when the component has already been destroyed
2015-11-12 12:56:27 +00:00

42 lines
1.4 KiB
JavaScript

/* jshint expr:true */
import { expect } from 'chai';
import {
describe,
it
} from 'mocha';
import Ember from 'ember';
import ValidationEngineMixin from 'ghost/mixins/validation-engine';
describe('ValidationEngineMixin', function () {
// Replace this with your real tests.
// it('works', function () {
// var ValidationEngineObject = Ember.Object.extend(ValidationEngineMixin);
// var subject = ValidationEngineObject.create();
// expect(subject).to.be.ok;
// });
describe('#validate', function () {
it('loads the correct validator');
it('rejects if the validator doesn\'t exist');
it('resolves with valid object');
it('rejects with invalid object');
it('clears all existing errors');
describe('with a specified property', function () {
it('resolves with valid property');
it('rejects with invalid property');
it('adds property to hasValidated array');
it('clears existing error on specified property');
});
it('handles a passed in model');
it('uses this.model if available');
});
describe('#save', function () {
it('calls validate');
it('rejects with validation errors');
it('calls object\'s #save if validation passes');
it('skips validation if it\'s a deletion');
});
});