Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
config.action_controller.perform_caching = false
config.cache_store = :null_store

# Use memory store for rate limiting (null_store silently disables it)
config.action_controller.cache_store = :memory_store

# Render exception templates for rescuable exceptions and raise for other exceptions.
config.action_dispatch.show_exceptions = :rescuable

Expand Down
2 changes: 1 addition & 1 deletion test/controllers/join_codes_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class JoinCodesControllerTest < ActionDispatch::IntegrationTest
end

test "create is rate limited" do
Rails.cache.stubs(:increment).returns(11)
ActionController::Base.cache_store.stubs(:increment).returns(11)

post join_path(code: @join_code.code, script_name: @account.slug), params: { email_address: "[email protected]" }

Expand Down
1 change: 1 addition & 0 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class TestCase
class ActionDispatch::IntegrationTest
setup do
integration_session.default_url_options[:script_name] = "/#{ActiveRecord::FixtureSet.identify("37signals")}"
ActionController::Base.cache_store.clear
end

private
Expand Down