https://gist.github.com/2013912
It works fine against my implementation, I am however concerned that
it works "by accident". I am using $resource service and I have no
idea where does the order of parameters comes from. For example:
var criteria = {page:1, orderBy:'age:asc', name: 'smith'};
SomeResource.query(criteria);
produces query:
'some/url?name=smith&orderBy=age:asc&page=1'
Do you have any idea how to make proper expectations for the above in
test? The order of parameters does not matter for server, maybe the
$httpBackend mock would have to support parameters as an object?
By the way: if you find some malpractice in that test, let me know,
because (maybe) I will use it for my next blog entry.
_____________
(*1) slide #19
https://docs.google.com/present/view?id=d449gch_277fc6wwc9s
_____________
Thanks,
Witold Szczerba
Another thing is, that even though a duck-type regexp substitute is
used, the provided example shows:
return angular.equals(params, parseUrlEncoded(urlEncodedArgs));
I suppose the 'parseUrlEncoded' function is not accessible from
outside of AngularJS code base, and even if it actually is accessible,
then it is, again, the implementation detail that $resource is using
that function and not something else to produce a set of parameters in
URL string.
Regards,
Witold Szczerba
> --
> You received this message because you are subscribed to the Google Groups
> "AngularJS" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/angular/-/ziG17cE0zOAJ.
> To post to this group, send email to ang...@googlegroups.com.
> To unsubscribe from this group, send email to
> angular+u...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/angular?hl=en.