Green specs for ember 1.13
This commit is contained in:
@@ -27,6 +27,7 @@ Ember.Application.initializer
|
||||
application.register('global:variables', Globals, {singleton: true})
|
||||
application.inject('controller', 'globals', 'global:variables')
|
||||
application.inject('component', 'globals', 'global:variables')
|
||||
application.inject('route', 'globals', 'global:variables')
|
||||
|
||||
@App = Ember.Application.create
|
||||
LOG_TRANSITIONS: true
|
||||
|
||||
@@ -2,8 +2,10 @@ ControllerExtensions = Ember.Mixin.create
|
||||
needs: ['application']
|
||||
ajaxError: (callback)->
|
||||
handler = (emberError)=>
|
||||
emberError = emberError.errors[0] if emberError.errors and emberError.errors.length
|
||||
console.log "Error: status #{emberError.status}"
|
||||
if emberError.status is 401
|
||||
status = parseInt(emberError.status)
|
||||
if status is 401
|
||||
App.__container__.lookup('route:application').unauthorized()
|
||||
else
|
||||
callback.call(@, emberError)
|
||||
|
||||
Reference in New Issue
Block a user