restangular icon indicating copy to clipboard operation
restangular copied to clipboard

Not able to inject Restangular in a Jasmine test

Open pankajtandon opened this issue 13 years ago • 4 comments

Hi, While this may not be directly a Restangular issue, it is kind of related so I'm posting it here.

I am not able to inject Restangular into a plain Jasmine test. My module uses Restangular and when I try to inject my module into the test I get Error: Argument 'fn' is not a function, got string from restangular in http://code.angularjs.org/1.1.5/angular.min.js (line 17)

Here's a plunk that demonstrates this. http://plnkr.co/edit/hNmxWR?p=options

Can someone please advice how a module that uses Restangular is supposed to be injected into my test?

Thanks!

pankajtandon avatar Jul 12 '13 02:07 pankajtandon

Hey,

You can take a look at Restangular tests. I inject it there.

Maybe that will help!

mgonto avatar Jul 12 '13 05:07 mgonto

Could you work this out?

mgonto avatar Jul 12 '13 23:07 mgonto

Yes.. thanks.. restangularSpec.js helped!

pankajtandon avatar Jul 14 '13 00:07 pankajtandon

No problem :)

mgonto avatar Jul 14 '13 00:07 mgonto