Make webrat compatible with Rails 3, 4

(Copy what Devise gem does)