cfpb / retirement

Helping Americans make choices about retirement
https://www.consumerfinance.gov/retirement/before-you-claim/
Creative Commons Zero v1.0 Universal
23 stars 26 forks source link

Can we test for handling of bad responses from SSA further up the stack too? #100

Open willbarton opened 9 years ago

willbarton commented 9 years ago

There are already tests for bad responses from SSA in the retirement_api.utils package, but there do not appear to be any tests further up the stack. How to the views handle it? What's that look like client-side?

This could simply be a "they are" and close the issue, but I just want to be sure. The screen scraping is scary (and I know it's scary to you too, @higs4281).

higs4281 commented 9 years ago

@willbarton i don't think tests are needed further up the stack. the views don't call SSA. they call our internal endpoint, which calls SSA, and that's the first place we'll encounter any issue.

willbarton commented 9 years ago

@higs4281 Alright. At a glance, it wasn't clear to me what happens if there's an error. It looks like the error just propagates up through the view via the JSON past the view (the estimator endpoint doesn't seem to check for it). Would browser tests to make sure the error JSON is handled make sense though?