discourse/discourse — pull request #1978 by velesin (2014-02-19 17:04:22+00:00)
Title: Adds specs for PostsController#by_number.

by_number method wasn't covered by any tests. This PR ads tests for it and refactors tests for the nearly identical `show` method to use shared examples.

WARNING: when working on this PR I discovered that there is one difference between `show` and `by_number` methods: `show` method allows moderators to see trashed posts while `by_number` does not. I think that this was an omission and fixed `by_number` method to behave in the same way as `show`. If I'm wrong and this difference was intentional, don't merge this PR!