Upgrade rails to 3.2.13

Includes fixes for:

* [CVE-2013-1854]
* [CVE-2013-1855]
* [CVE-2013-1856]
* [CVE-2013-1857]

Upgrade caused issues with shoulda-matchers and mocha. More details:

* https://github.com/rails/rails/issues/9783
* https://github.com/thoughtbot/shoulda-matchers/pull/256

I'm monitoring the pull request on shoulda-matchers and will upgrade to stable version of the gem when it becomes available.

Also includes some test refactorings to avoid deprecation warnings caused by newer version of rspec and shoulda-matchers.