Add a test for nested resources from a addRestangularMethod result#902
Open
leahciMic wants to merge 2 commits intomgonto:masterfrom
Open
Conversation
be68a75 to
1a8fbe0
Compare
Collaborator
|
I think this looks good, but I'll have to read over it and review it in more depth before merging. Can you squash the commits into one or two commits please? |
This test identifies an issue I am currently having with `addRestangularMethod`.
Given the following code.
```js
var Accounts = Restangular.withConfig(function(RestangularConfigurer) {
RestangularConfigurer.addElementTransformer('users', true, function(worker) {
worker.addRestangularMethod('doSomething', 'get', 'do-something');
return worker;
});
}).service('accounts');
Accounts.doSomething().then(function(doSomething) {
doSomething.one('foo').get();
});
```
I would expect `doSomething.one('foo').get()` to fetch `accounts/do-something/foo`,
and not `accounts/foo`.
ecf4bc0 to
f73fcfb
Compare
Author
|
@daviesgeek it's definitely been a while since I've used this project. I have rebased the commits for you. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This test identifies an issue I am currently having with
addRestangularMethod.Given the following code.
I would expect
doSomething.one('foo').get()to fetchaccounts/do-something/foo,and not
accounts/foo.