From f5d1ae32e7faf2366cdd40355ca45233a482abef Mon Sep 17 00:00:00 2001 From: Jay Joshua <7008757+jayjay-w@users.noreply.github.com> Date: Wed, 29 May 2024 04:13:29 +0300 Subject: [PATCH] Fix flaky test in OmniauthIntegrationTest (#1902) Since we added rate limiting for login requests, we need to flush redis before the tests run. --- test/integration/omniauth_integration_test.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/integration/omniauth_integration_test.rb b/test/integration/omniauth_integration_test.rb index 97b05534c2..b01a32e567 100644 --- a/test/integration/omniauth_integration_test.rb +++ b/test/integration/omniauth_integration_test.rb @@ -1,6 +1,11 @@ require_relative '../test_helper' class OmniauthIntegrationTest < ActionDispatch::IntegrationTest + setup do + redis = Redis.new(REDIS_CONFIG) + redis.flushdb + end + test "should close in case of failure" do get '/api/users/auth/slack/callback', params: { error: 'access_denied' } assert_redirected_to '/close.html'