mardi 6 janvier 2015

Error in Testing using jasmine

the test case is and error is below this page



'use strict';

describe('$auth', function() {


beforeEach(module('authentication'));
beforeEach(inject(['$window', '$location', '$httpBackend', '$auth','$rootScope','$compile','$browser', function($window, $location, $httpBackend, $auth,$scope,$compile,$browser) {
this.$auth = $auth;
this.$window = $window;
this.$location = $location;
this.$httpBackend = $httpBackend;
this.$rootScope=$scope;
this.$compile=$compile;
this.$browser=$browser;


}]));

it('should be defined', function() {
expect(this.$auth).toBeDefined();
});

describe('check signup link', function() {
var spyEvent;
it('should show correct page', function(){


$('.CreateNewAccount').trigger( 'click' );

expect(this.$location.path).toHaveBeenCalledWith('somePage.com/signup');
// expect(this.browser().$location().path()).toBe("somePage.com/signup");
});

});



});


the error i got is



$auth check signup link should show correct page FAILED
Error: Expected a spy, but got Function.


Please help me to solve this problem i just want to check the signup link is redirect or not to the page signup


Aucun commentaire:

Enregistrer un commentaire