diff options
author | Michael Kozono <mkozono@gmail.com> | 2017-10-30 17:05:26 -0700 |
---|---|---|
committer | Francisco Lopez <fjlopez@gitlab.com> | 2017-11-17 09:58:18 +0100 |
commit | 6c5f46ace2ef5636e89822787a336c2b433d7dde (patch) | |
tree | b7c44e17dd27fe5da81b7d52644588ff0f15f8da | |
parent | 6ba13b41ff266a97c4c0c875686511311e2004f8 (diff) | |
download | gitlab-ce-6c5f46ace2ef5636e89822787a336c2b433d7dde.tar.gz |
Prevent affecting other tests
-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: |