Skip to content
Snippets Groups Projects
Commit 6c5f46ac authored by Michael Kozono's avatar Michael Kozono Committed by Francisco Javier López
Browse files

Prevent affecting other tests

parent 6ba13b41
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -22,14 +22,14 @@ describe 'Rack Attack global throttles' do
let(:period_in_seconds) { 10000 }
let(:period) { period_in_seconds.seconds }
 
before do
# Make time-dependent tests deterministic
around do |example|
# Instead of test environment's :null_store
Rack::Attack.cache.store = ActiveSupport::Cache::MemoryStore.new
end
 
# Make time-dependent tests deterministic
around do |example|
Timecop.freeze { example.run }
Rack::Attack.cache.store = Rails.cache
end
 
# Requires let variables:
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment