When unit testing the controller you create an instance of it using the $controller service and can provide mock injectables
... sent from my tablet
--
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 angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.
It takes a locals parameter where you can add your mocked resolves
Pete
...from my mobile.
I'm new to angular, and spent all afternoon struggling to inject a mock promise from a route resolve into my controller for unit testing. You said what I needed to hear. (Thanks for that light bulb moment!)
So is the following statement accurate?
The question of (and appropriate testing domain) for whether or not the promise resolves is upstream of the controller. Once we enter the unit tests for the controller, a successful promise resolution is already (and safely) assumed.