Replies: 1 comment 3 replies
-
|
The way that Devise implements these tests seems very hacky and complex, either relying on global state (system tests) or jumping through a lot of hoops to assign the right instance variables on the controller and Warden instances. I don't want rodauth-rails' test helpers to have this kind of complexity. I was hoping it's possible to just set session values, but I'm not sure how to do it in integration tests. One would also need to remember to set all the necessary session values, as Rodauth doesn't work only with account ID. Doing actual authentication is definitely the most robust, it's unfortunate that it seems to be adding so much overhead. I would be curious which parts of those auth requests are adding the most overhead. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am continuing with some ideas from my Devise => Rodauth migration.
Devise provides some useful controller and system/integration helpers for testing and it would be great to have similar ones for Rodauth.
I implemented some for my system & integration tests using the informations in the readme, but those are making real auth requests and this is quite inefficient (my test suite is 30% slower compared to before as it needs to log in for most of the tests), it will fail every tests if auth breaks and you need to know the password for each user you are logging with.
Would it be possible to have some helpers to set
env["rodauth"].session_valueat the start of a test (setupblock) and reset Rodauth's session inteardown?You could then do
Beta Was this translation helpful? Give feedback.
All reactions