devise icon indicating copy to clipboard operation
devise copied to clipboard

Set `attempted_path` in `warden.options` before calling failure app in controller test helpers

Open cgunther opened this issue 10 months ago • 0 comments

In controller tests, the failure app seems to be called directly rather than going through Warden. As such, it duplicates some of the set up Warden does before calling the failure app, however didn't set attempted_path, like Warden does. Therefore, if your custom failure app relied on attempted_path, it wouldn't be set in your controller tests, leading to different behavior in tests versus production.

This now brings the test helper closer in-line with the Warden implementation.

https://github.com/wardencommunity/warden/blob/67f5ba6baaa7564ec79afef02cf3a4d0f7d312e5/lib/warden/manager.rb#L138-L143

This is similar in nature to #3968, but includes a test, though in my case, my issue wasn't related to relative_url_root, so I can't speak to that side of the original issue.

cgunther avatar Mar 01 '25 19:03 cgunther