Ghost/core/client/tests/helpers/adapter-error.js
Austin Burdine 9f827204df fix 404 error handling in editor, tags, and team routes
closes #6094
- adds 404-handler mixin
- applies mixin to settings/tags/tag, editor/edit and team/user routes
- adds adapter-error test helper to override the default adapter error
2015-12-03 16:37:23 -06:00

20 lines
581 B
JavaScript

import Ember from 'ember';
// This is needed for testing error responses in acceptance tests
// See http://williamsbdev.com/posts/testing-rsvp-errors-handled-globally/
let originalException;
let originalLoggerError;
export function errorOverride() {
originalException = Ember.Test.adapter.exception;
originalLoggerError = Ember.Logger.error;
Ember.Test.adapter.exception = function () {};
Ember.Logger.error = function () {};
}
export function errorReset() {
Ember.Test.adapter.exception = originalException;
Ember.Logger.error = originalLoggerError;
}