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

Gem yields 500 Internal Server Error during tests #435

Open
xanadiu opened this issue Nov 24, 2023 · 3 comments
Open

Gem yields 500 Internal Server Error during tests #435

xanadiu opened this issue Nov 24, 2023 · 3 comments

Comments

@xanadiu
Copy link

xanadiu commented Nov 24, 2023

Problem

Despite the following readme statement

By default, reCAPTCHA is skipped in "test" and "cucumber" env.

I discovered that the Gem can cause "Completed 500 Internal Server Error" entries in test.log. This occurs when the environment variable RECAPTCHA_SITE_KEY is not set, independent of its value.

That happened to me during CI jobs where only minimal environment variables were defined. Only after providing an empty site key environment variable the tests succeeded.

Expected behaviour

It would be great if the Gem really and cleanly is skipped in test environments without the need of (empty) environment variables.

System information

  • recaptcha: 5.16.0
  • Rails: 6.1.4.1
@grosser
Copy link
Collaborator

grosser commented Nov 24, 2023

PR welcome ... do you have the backtrace ?

@xanadiu
Copy link
Author

xanadiu commented Nov 25, 2023

I did not yet investigate the Gem internals, so I have no starting point for a PR.

Concerning the error or unexpected behaviour: how can I generate a backtrace? My observation is that the log only contains "Completed 500 Internal Server Error" without further context info, even with config.log_level = :debug.

@grosser
Copy link
Collaborator

grosser commented Nov 26, 2023

could go into the gem bundle open and add a raise where it does the request
or check the code for where the site key is checked and change things there until the test works (locally)

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

No branches or pull requests

2 participants