Refactor rspec tests and add application helper to spec directory