Adapt tests to Rails 4
A lot of tests require small changes we can apply in Rails 3 already to make the actually breaking Rails 4 changes smaller. https://github.com/theforeman/foreman/pull/2055/files
Fixes #11089 - Adapt tests to Rails 4
This commit contains all changes to tests in branch
https://github.com/theforeman/foreman/pull/2055 that I found to be
retrocompatible with Rails 3. The more of these we can get in, the less
code we will have to review for Rails 4, and the more relevant it will
be, as it'll be all completly Rails 4 specific.