Swap out puts error messages for render json response#3
Swap out puts error messages for render json response#3
Conversation
|
At this point, do you think it's worth it to write an automated test for this endpoint? Maybe a request spec? |
|
Hm. I had a request spec in there but it looks like its not working as intended. Im going to get it fixed today. I do have a question for you @speric. I've changed some of the error handling in the controller from puts to render json. But some of the error handling has been abstracted away in logic away from the controller (customer.rb and fakepayservice.rb). It appears that the render json only works in the controller and I'm trying to figure out how to turn that error handling into some actionable in the api response. So far im looking at the rescue_from method. Is that a good path to go down or do you have an alternative recommendation? Thanks |
@speric
Swapped out the puts error messages for a JSON response. Please review