For some reason when I try to set param with...
$location.search('id', 2);
... on AngularJS unit tests (Karma + PhantomJS), it doesn't set, even with $apply set. And if I test it straight away...
expect($location.search().id).toEqual(2);
... it would give me that ID is undefined.
Am I doing something wrong?
Try spy