summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Kozono <mkozono@gmail.com>2017-10-30 17:05:26 -0700
committerFrancisco Lopez <fjlopez@gitlab.com>2017-11-17 09:58:18 +0100
commit6c5f46ace2ef5636e89822787a336c2b433d7dde (patch)
treeb7c44e17dd27fe5da81b7d52644588ff0f15f8da
parent6ba13b41ff266a97c4c0c875686511311e2004f8 (diff)
downloadgitlab-ce-6c5f46ace2ef5636e89822787a336c2b433d7dde.tar.gz
Prevent affecting other tests
-rw-r--r--spec/requests/rack_attack_global_spec.rb8
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: