Closed fero46 closed 11 months ago
Hi, @fero46, thanks for reporting. Could you please share which is the exception you're finding?
So, I printed out the response body in my RSpec test, and I received the following JSON:
{"error": "No verification key available"}
After investigating this error, I found this device configuration:
jwt.secret = Rails.application.credentials.jwt_secret_key
I checked my test environment configuration and discovered that I don't have MASTER_KEY set in the test environment. So, I had to create a secret key only for the test environment.
In my humble opinion, this should be documented or there should be a default secret key for the testing environment.
Thanks for the update, @fero46. It looks like that's a specific Rails issue, maybe related to recent changes on 7.1. . Closing here.
Issue Description: I'm encountering an issue with the
Devise::JWT::TestHelpers
that was previously working fine in my test setup. The problem seems to be related to user authentication when using the helper in conjunction with RSpec tests.Steps to Reproduce:
I'm creating the headers for my request test as described in the documentation:
In my test, I'm making a request like this:
However, I'm encountering an exception when trying to authenticate the user.
Expected Behavior: I expected the authentication process to work as it did previously when using the
Devise::JWT::TestHelpers
with my RSpec tests.Actual Behavior: I'm currently encountering an exception when attempting to authenticate the user, and I'm unsure of the root cause of this issue. I've verified that the request header appears to be correctly formatted, as shown here:
Additional Information:
Notes: I had to skip approximately 80 RSpec tests due to this issue, and I'm unsure about what might have caused this problem. Any help or guidance on resolving this issue would be greatly appreciated.
Environment Information:
Thank you for your assistance in resolving this issue.