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