Skip to content

Conversation

@ashwin47
Copy link

Summary

  • Configure config.action_controller.cache_store = :memory_store so rate limiting works in tests
  • Clear the cache in IntegrationTest setup to prevent state leaking across tests
  • Update join_codes_controller_test to stub the correct cache store

Context

Rails uses config.cache_store for rate limiting by default. Since test environment uses :null_store, rate
limiting was silently disabled. See rails/rails#56183.

By default, Rails uses the cache_store for rate limiting. Since the test
environment uses :null_store, rate limiting was silently disabled in tests.

This configures a separate :memory_store for action_controller.cache_store
so rate limiting actually works in tests. The cache is cleared in the
IntegrationTest setup to prevent rate limit data from persisting across tests.

Also updates the join_codes_controller_test to stub the correct cache store.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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

Successfully merging this pull request may close these issues.

1 participant