2017-04-29 10:54:46 +02:00
|
|
|
'use strict'
|
2017-04-03 16:01:53 +02:00
|
|
|
/* global describe, it, inject, expect, beforeEach, jasmine */
|
|
|
|
|
|
|
|
describe('AppImPanelController', function () {
|
|
|
|
beforeEach(module('myApp.controllers'))
|
|
|
|
|
|
|
|
beforeEach(function () {
|
|
|
|
inject(function (_$controller_, _$rootScope_) {
|
2017-06-28 17:03:49 +02:00
|
|
|
this.$scope = _$rootScope_.$new()
|
|
|
|
this.$scope.$on = jasmine.createSpy('$on')
|
|
|
|
_$controller_('AppImPanelController', { $scope: this.$scope })
|
2017-04-03 16:01:53 +02:00
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
// define tests
|
|
|
|
it('sets $on(user_update) to no-operation function', function (done) {
|
2017-06-28 17:03:49 +02:00
|
|
|
expect(this.$scope.$on).toHaveBeenCalledWith('user_update', angular.noop)
|
2017-04-03 16:01:53 +02:00
|
|
|
done()
|
|
|
|
})
|
|
|
|
})
|