Prevent affecting other tests
This commit is contained in:
parent
6ba13b41ff
commit
6c5f46ace2
1 changed files with 5 additions and 5 deletions
|
@ -22,14 +22,14 @@ describe 'Rack Attack global throttles' do
|
|||
let(:period_in_seconds) { 10000 }
|
||||
let(:period) { period_in_seconds.seconds }
|
||||
|
||||
before do
|
||||
# Instead of test environment's :null_store
|
||||
Rack::Attack.cache.store = ActiveSupport::Cache::MemoryStore.new
|
||||
end
|
||||
|
||||
# Make time-dependent tests deterministic
|
||||
around do |example|
|
||||
# Instead of test environment's :null_store
|
||||
Rack::Attack.cache.store = ActiveSupport::Cache::MemoryStore.new
|
||||
|
||||
Timecop.freeze { example.run }
|
||||
|
||||
Rack::Attack.cache.store = Rails.cache
|
||||
end
|
||||
|
||||
# Requires let variables:
|
||||
|
|
Loading…
Reference in a new issue