From 8b9c65fbeda40b7cf424d74252333537e3d55446 Mon Sep 17 00:00:00 2001 From: ColinBruce Date: Wed, 7 Feb 2024 15:21:41 +0000 Subject: [PATCH] Fix: Flickering SAML tests This is a race condition that checks the count of values in the page history, if other tests visit pages first it causes a false positive in these tests. The fix clears the test redis instance for the page_history database before each test in this block --- spec/requests/saml_sessions_spec.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/spec/requests/saml_sessions_spec.rb b/spec/requests/saml_sessions_spec.rb index 2b82be6c7a..744ae8e2e6 100644 --- a/spec/requests/saml_sessions_spec.rb +++ b/spec/requests/saml_sessions_spec.rb @@ -10,7 +10,10 @@ let(:provider_details_api_reponse) { api_response.to_json } let(:enable_mock_saml) { false } - before { allow(Rails.configuration.x.laa_portal).to receive(:mock_saml).and_return(enable_mock_saml) } + before do + allow(Rails.configuration.x.laa_portal).to receive(:mock_saml).and_return(enable_mock_saml) + Redis.new(url: Rails.configuration.x.redis.page_history_url).flushdb + end describe "DELETE /providers/sign_out" do subject(:delete_request) { delete destroy_provider_session_path }