Fix url_for_patch to work with rails 4.2
Fix some broken tests