scienceexchange/ruby — pull request #2 by mkompanets (2014-09-23 07:43:33+00:00)
Title: Comments endpoint

* Functionally this adds 2 endpoints for put and post for comments
* Names of methods were changed to look more like restful, railsish names, like destroy_ vs. delete and show_ vs. get_ .
* I named POST for comments as add_file_to_comments, because as far as I can tell, all it does is add a file attachment to a comment. No actual comment can be created with this method.
* Added query parameters to make external usage more explicit about the arguments being passed in.

@dior001 please take a look.
Tests still need attention. I think there is a flaw in the regex for the fixture file name generator. It doesn't handle query parameters. Instead of an exception it just cuts off the expected name. Everything but the .json extension.

We should probably talk about the expectations for the tests here. There is gotta be a good way to test update methods, for example. I want to confirm that an actual update happened to the method. Not sure how to do that with fixtures.

Also, let me know what you think about the method names and query parameters. Ideally I think it would be cool to call these methods from a namespace. Something like, `Insightly::Comment.update(comment: comment)` instead of `Insightly.client.update_comment(comment: comment)`. The structure is all in place now though, I didn't find a quick way to do this. Also, not sure if that would even be a good idea.