add spec tests. remove Rails.logger.info message for errors.