cangevine/STEAMnet — pull request #41 by maxluzuriaga (2013-06-24 05:23:01+00:00)
Title: Username/tags validation, tags controller changes, many many tests.

New: regex validation of usernames and tags. This should prevent usernames or tags with whitespace or malicious characters, only allowing numbers, letters, underscores, and hyphens.

Also new for the tags controller: instead of accessing tags by ids, instead they are now accessed by their tag_texts. Before, they would be at `/api/v1/tags/1.json`, now they might be found at `/api/v1/tags/yellow.json`.

BC: I also changed the type of the `tag_text` column of `tags`, from text to string, to fit better with how we're using tags in STEAMnet, so make sure to run `rake db:migrate` when you push this code to Heroku.

Also included: refactoring to make a lot of controller code less redundant.

I also finished writing tests for all existing models and controllers, as well as new tests for all the new functionality included. By my estimation, just about every facet of this code base has an equivalent test case. This now adds up to just shy of 200 passing tests. I'm very very happy with this.

I'll try to write up the README as soon as I can, as Documentation is sorely lacking for this API. (Sorry Sam!)