OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Add a test to the discard of the cached token
Marcello Rocha8397b3f2883f
diff --git a/modules/storages/spec/common/storages/peripherals/storage_interaction/authentication_strategies/o_auth_client_credentials_spec.rb b/modules/storages/spec/common/storages/peripherals/storage_interaction/authentication_strategies/oauth_client_credentials_spec.rbsimilarity index 90%rename from modules/storages/spec/common/storages/peripherals/storage_interaction/authentication_strategies/o_auth_client_credentials_spec.rbrename to modules/storages/spec/common/storages/peripherals/storage_interaction/authentication_strategies/oauth_client_credentials_spec.rbindex 070d6669811..eb18533212f 100644--- a/modules/storages/spec/common/storages/peripherals/storage_interaction/authentication_strategies/o_auth_client_credentials_spec.rb+++ b/modules/storages/spec/common/storages/peripherals/storage_interaction/authentication_strategies/oauth_client_credentials_spec.rb@@ -67,6 +67,18 @@ RSpec.describe Storages::Peripherals::StorageInteraction::AuthenticationStrategiexpect(result).to be_failureexpect(result.result).to eq("It failed")end++ it "clears an already existing token" do+ Rails.cache.write("storage.#{storage.id}.httpx_access_token", "BORKED_TOKEN")++ strategy.call(storage:) do |http|+ http.get("https://graph.microsoft.com/v1.0/drives/#{storage.drive_id}/root").raise_for_status+ rescue HTTPX::Error+ ServiceResult.failure(result: :forbidden)+ end++ expect(Rails.cache.fetch("storage.#{storage.id}.httpx_access_token")).to be_nil+ endendcontext "when the attempted request works" do