added helper method to set title properly and updated rspec tests