upgrade to rails 4

also some amendments to specs to make them work