test: fix test for jasmine-core 2.x

ref - http://stackoverflow.com/questions/27680933/jasmine-have-createspy-return-mock-object
This commit is contained in:
1ambda 2016-11-19 23:58:43 +09:00
parent ded1f2c0dc
commit ac40b5690d
2 changed files with 4 additions and 3 deletions

View file

@ -38,6 +38,7 @@
"grunt-svgmin": "^0.4.0",
"grunt-usemin": "^2.1.1",
"grunt-wiredep": "~2.0.0",
"jasmine-core": "^2.5.2",
"karma": "~1.3.0",
"karma-coverage": "^1.1.1",
"karma-jasmine": "~1.0.2",

View file

@ -61,7 +61,7 @@ describe('Controller: ParagraphCtrl', function() {
it('should call loadTableData() and getGraphMode() should return "table" when the result type is "TABLE"',
function() {
scope.getResultType = jasmine.createSpy('getResultType spy').andCallFake(function() {
scope.getResultType = jasmine.createSpy('getResultType spy').and.callFake(function() {
return 'TABLE';
});
spyOn(scope, 'setGraphMode');
@ -71,7 +71,7 @@ describe('Controller: ParagraphCtrl', function() {
});
it('should call renderHtml() when the result type is "HTML"', function() {
scope.getResultType = jasmine.createSpy('getResultType spy').andCallFake(function() {
scope.getResultType = jasmine.createSpy('getResultType spy').and.callFake(function() {
return 'HTML';
});
spyOn(scope, 'renderHtml');
@ -80,7 +80,7 @@ describe('Controller: ParagraphCtrl', function() {
});
it('should call renderAngular() when the result type is "ANGULAR"', function() {
scope.getResultType = jasmine.createSpy('getResultType spy').andCallFake(function() {
scope.getResultType = jasmine.createSpy('getResultType spy').and.callFake(function() {
return 'ANGULAR';
});
spyOn(scope, 'renderAngular');