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

Improve unit tests for QuestionPresenter#error #2086

Merged
merged 1 commit into from
Nov 16, 2015

Conversation

floehopper
Copy link
Contributor

My main objective here was to cover the behaviour when an
SmartAnswer::InvalidResponse is raised with a text message and the default
error message in the i18n YAML file interpolates this error. Currently this
behaviour is only tested in the InputValidationTest integration test, but
there's so much going on in there it's hard to see the wood for the trees.

I'm not convinced that this behaviour is very sensible nor do I think it is used
anywhere in the published smart answer flows. However, it does appear as if
there are quite a few places where a custom String is set as the exception
message rather than an error message key. Since I believe the mechanism
described above is the only way such messages could currently be displayed to
the user, I'm loathe to remove it without providing a replacement.

I've also clarified that the final fallback error message is system-wide and not
just for the question's flow.

Expected observable changes

  • None

@chrisroos
Copy link
Contributor

Looks good to me.

@chrisroos chrisroos added the LGTM label Nov 16, 2015
My main objective here was to cover the behaviour when an
`SmartAnswer::InvalidResponse` is raised with a text message and the default
error message in the i18n YAML file interpolates this error. Currently this
behaviour is only tested in the `InputValidationTest` integration test, but
there's so much going on in there it's hard to see the wood for the trees.

I'm not convinced that this behaviour is very sensible nor do I think it is used
anywhere in the published smart answer flows. However, it does appear as if
there are quite a few places where a custom String is set as the exception
message rather than an error message key. Since I believe the mechanism
described above is the only way such messages could currently be displayed to
the user, I'm loathe to remove it without providing a replacement.

I've also clarified that the final fallback error message is system-wide and not
just for the question's flow.
@floehopper floehopper force-pushed the improve-unit-tests-for-question-presenter-error branch from a5ebe2b to 6a60bf3 Compare November 16, 2015 11:07
@floehopper
Copy link
Contributor Author

I've rebased this against master and force-pushed in preparation for merging.

@floehopper
Copy link
Contributor Author

I believe the build failed due to a race condition in one of the JS-enabled integration tests. I've kicked off another build manually.

floehopper added a commit that referenced this pull request Nov 16, 2015
…n-presenter-error

Improve unit tests for QuestionPresenter#error
@floehopper floehopper merged commit af8d7c8 into master Nov 16, 2015
@floehopper floehopper deleted the improve-unit-tests-for-question-presenter-error branch November 16, 2015 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants