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

fix_for_failing_redmine_api_key_test #108

Merged
merged 4 commits into from
Mar 9, 2022

Conversation

liaham
Copy link
Contributor

@liaham liaham commented Mar 6, 2022

Hi @mikitex70,

during redmine test with redmine_drawio plugin installed I recognized a failing redmine test since redmine_drawio creates by
default an api key for the current user even if the api is disabled. This will happen in RedmineDrawio::ViewLayoutsBaseHtmlHeadHook when providing the hash code.

In order to fix that redmine test failure I created this pull request which provides the api key only if the api is enabled. Furthermore, it will render a warning for the administrator if the api is not enabled.

And of course, I added some tests. :)

Please let me know if there could be done something better.

Best Regards,
liaham

Update: In contrast to the first PR I fixed a wrong api check and added further tests.

liaham added 4 commits March 6, 2022 14:49
When the api is not enabled there should be no api key requested
for the current user. Moreover, Redmine
MyControllerTest#test_reset_api_key_without_existing_key
would fail since it does not expect the current user to have an api key by
default.

Added a warning for the admin if api is disabled since the plugin needs
the api for saving diagrams as attachment.
ViewLayoutsBaseHtmlHeadHook#hash_code uses a wrong api enabled check which
would not return true if rest api is enabled.
@mikitex70 mikitex70 merged commit 13658fd into mikitex70:develop Mar 9, 2022
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.

2 participants