Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return 200 for validation errors #155

Closed
wants to merge 1 commit into from

Conversation

@bilbof
Copy link
Contributor

bilbof commented Mar 23, 2020

These will get logged anyway if we have the log level set to info.

https://trello.com/c/tZRgrJPt/161-style-422-errors-nicely-since-were-serving-a-lot-of-them

These will get logged anyway if we have the log level set to info.

https://trello.com/c/tZRgrJPt/161-style-422-errors-nicely-since-were-serving-a-lot-of-them
expect(response).to render_template(current_template)
end

it "validates a valid option is chosen" do
post :submit, params: { basic_care_needs: "<script></script>" }
expect(response).to have_http_status(:unprocessable_entity)

This comment has been minimized.

Copy link
@huwd

huwd Mar 23, 2020

Contributor

Does render templat imply a 200 or can we do to_have_http_status(:success) or something similar?

@huwd
huwd approved these changes Mar 23, 2020
Copy link
Member

injms left a comment

I'd like to make sure that we are actually logging the validation errors before this is merged in and we lose the ability to tell what parts of the form that users are struggling with.

@bilbof

This comment has been minimized.

Copy link
Contributor Author

bilbof commented Mar 31, 2020

I'd prefer not to do this, since having 422s in the logs is quite useful. I'm going to close this for now.

@bilbof bilbof closed this Mar 31, 2020
@bilbof bilbof deleted the bilbof/return-200-for-validation-errors branch Mar 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.