wrote the tests and code for the followings
updated rails version