diff options
author | Michael Kozono <mkozono@gmail.com> | 2017-10-31 03:05:26 +0300 |
---|---|---|
committer | Francisco Lopez <fjlopez@gitlab.com> | 2017-11-17 11:58:18 +0300 |
commit | 6c5f46ace2ef5636e89822787a336c2b433d7dde (patch) | |
tree | b7c44e17dd27fe5da81b7d52644588ff0f15f8da /spec/requests/rack_attack_global_spec.rb | |
parent | 6ba13b41ff266a97c4c0c875686511311e2004f8 (diff) |
Prevent affecting other tests
Diffstat (limited to 'spec/requests/rack_attack_global_spec.rb')
-rw-r--r-- | spec/requests/rack_attack_global_spec.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/spec/requests/rack_attack_global_spec.rb b/spec/requests/rack_attack_global_spec.rb index 7d98ee08a0a..aa9aa99bbba 100644 --- a/spec/requests/rack_attack_global_spec.rb +++ b/spec/requests/rack_attack_global_spec.rb @@ -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: |