Rails 4 test version.

With full cleanup for readability.