Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Kozono <mkozono@gmail.com>2017-10-31 03:05:26 +0300
committerFrancisco Lopez <fjlopez@gitlab.com>2017-11-17 11:58:18 +0300
commit6c5f46ace2ef5636e89822787a336c2b433d7dde (patch)
treeb7c44e17dd27fe5da81b7d52644588ff0f15f8da /spec/requests/rack_attack_global_spec.rb
parent6ba13b41ff266a97c4c0c875686511311e2004f8 (diff)
Prevent affecting other tests
Diffstat (limited to 'spec/requests/rack_attack_global_spec.rb')
-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: