Issue 1002 : Updated api/users#1014
Conversation
|
Hi Daniel, Your code looks very good and clean. Would it be interesting to put output to log each time API are called? For me, your code is ready to be merged. I'd like someone else to test your code :) and then we will merge it! |
|
@benjaminvialle I'm not sure why you're getting one failed test. When I run the tests, ie using Any idea what's going on? |
|
I haven't been able to reproduce any errors with that test condition. The code in question is: And it's within the following context: The idea is that all 3 users should be returned in the result's body as badfiler:invalid will be ignored, and all 3 users are of type student. No tests within that context modify those users, so I don't know why it would fail. A manual curl request imitating the test case also works for me:
What version of Ruby are you using, and Rails? |
|
I ran the above tests and they all passed for me too: |
|
Hi @danielstjules , I was using Ruby 1.9.3-p194 and RoR 3.0.19. I will test this code again this evening. Stay tuned ;) |
|
Thanks! I'm unable to test on 1.9.3 as I couldn't build the svn ruby bindings on OSX using that version. I believe swig fails during make. It looks like both Mike and I are using 1.8.7-p371 though. |
|
@benjaminvialle Don't mean to bother you, but did you try running the tests again? And any chance you could run that curl request and see if you get any results? I'm gonna reinstall Fedora and try building the svn ruby bindings with 1.9.3 on it to test it myself as well. |
|
@danielstjules I have done the tests again. They all paa. Sorry for the noise. Your patch is ready to be merged for me . |
|
Other than spelling errors I commented on, pull request looks good! |
|
@m-bodmer @benjaminvialle Thanks! I've got the spellchecker enabled now lol |
|
@danielstjules Please also update the wiki page as to how to use the new API if you get a chance. I expect this changed and we are lacking user documentation for it anyway :) Thanks! |
|
Don't worry - it's part of the long-term plan :) I've got some rough documentation already written up, and will probably make an update to the wiki later this month. |
This follows the details specified at #1002
Quick overview:
-api/users now uses :id for show and update methods
-limit, offset and filter parameters are available for retrieving collections (index method)
-the filter parameter is available to show and index methods to restrict which attributes are returned for each resource
-The changes do not conflict with any of the other current API routes