discourse/discourse — pull request #628 by ZogStriP (2013-04-02 23:26:52+00:00)
Title: add UploadsController specs

Before doing any server-side work on the image uploads feature ([`ImageOptimizer`](https://github.com/discourse/discourse/blob/master/lib/image_optimizer.rb), *I'm looking at you*) I wanted to validate the current behavior.

Hence, this pull request.

The purpose of this PR is actually twofold:

1. Provide more specs coverage, **obviously**
2. More **importantly**, get a feedback from the core team on how to test file uploads.

**Sidenote**: For security reason, I added `ensure_logged_in` before filter to the controller and required the `topic_id` parameter.