Hi

Can anyone tel me how to write angularjs JASMINE tests to test a service 
that I wrote that returns a AJS promise?

I tried the below and my function dialogSignInLoopUntilSuccess never gets 
resolved.


describe (
'test foo():',
function () {
var myObjUser;

it ( 'is now a lot easier aaa',
inject (
function ( $httpBackend ) {

myService.dialogSignInLoopUntilSuccess ( 'test2' )
.then (
// success
function ( objUser ) {
myObjUser = objUser;
},
function ( objUser ) {
myObjUser = objUser;
}
);

$rootScope.$apply(); // recognize promise when it resolves

expect ( myObjUser.boolSignedIn ).toBe ( true );
expect ( myObjUser.strName ).toBe ( 'test' );
}
)
)
}
); // describe


THANK you so MUCH

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to