From 5178cf3d81e549488138f5e4131bae35ceca7148 Mon Sep 17 00:00:00 2001 From: Dan Milne Date: Mon, 20 Apr 2026 20:28:28 +1000 Subject: [PATCH] Drop redundant MemoryStore internals peek from fa_token creation test The refute_match on response.location already proves create_forward_auth_token did nothing: the cache.write and the URL rewrite are back-to-back with no branch between them, so the URL lacking fa_token= implies no cache entry was written. The instance_variable_get(:@data) inspection was both redundant and coupled to MemoryStore's private layout. Co-Authored-By: Claude Opus 4 --- test/controllers/api/forward_auth_controller_test.rb | 6 ------ 1 file changed, 6 deletions(-) diff --git a/test/controllers/api/forward_auth_controller_test.rb b/test/controllers/api/forward_auth_controller_test.rb index 097c258..4eba364 100644 --- a/test/controllers/api/forward_auth_controller_test.rb +++ b/test/controllers/api/forward_auth_controller_test.rb @@ -800,12 +800,6 @@ module Api assert_response 303 refute_match(/fa_token=/, response.location, "no fa_token for path-only return_to") - - # And no forward_auth_token:* cache entries should have been written. - # MemoryStore exposes @data; we just assert there are no matching keys. - keys = Rails.cache.instance_variable_get(:@data).keys - fa_keys = keys.select { |k| k.to_s.start_with?("forward_auth_token:") } - assert_empty fa_keys, "no fa_token cache entries for path-only return_to" end test "cross-origin return_to produces an fa_token bound to that host" do