Here is my temp.js
angular.module('temp', [])
.service('tempFactory', function() {
this.a = 10;
})
.controller('tempCtrl', function($scope, tempFactory) {
$scope.a = tempFactory.a;
});
and here is my temp.Spec.js
describe('temp', function() {
var ctrl, scope;
beforeEach(function() {
module('temp');
inject(function($rootScope, $controller) {
scope = $rootScope.new();
ctrl = $controller('tempCtrl', {$scope: scope});
});
});
});
I know that to test service method call it is necessary to use spy. But how to test service property call(in my code it is $scope.a = tempFactory.a;)? How can I find out that some property of any service were called?
Write a spec that tests the value on scope. No spy needed. Write something to the effect of: