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
[#60151] amend tests according to PR comments
Eric Schubert7b5237195391
diff --git a/modules/storages/spec/common/storages/peripherals/storage_interaction/authentication_strategies/nextcloud_strategies/user_bound_spec.rb b/modules/storages/spec/common/storages/peripherals/storage_interaction/authentication_strategies/nextcloud_strategies/user_bound_spec.rbindex b5424ad0997..6cb085ebbc3 100644--- a/modules/storages/spec/common/storages/peripherals/storage_interaction/authentication_strategies/nextcloud_strategies/user_bound_spec.rb+++ b/modules/storages/spec/common/storages/peripherals/storage_interaction/authentication_strategies/nextcloud_strategies/user_bound_spec.rb@@ -32,45 +32,66 @@ require "spec_helper"require_module_spec_helperRSpec.describe Storages::Peripherals::StorageInteraction::AuthenticationStrategies::NextcloudStrategies::UserBound do- context "if file storage is configured for sso and oauth and user is provisioned by an IDP" do+ context "if user is provisioned by an IDP" dolet(:provider) { create(:oidc_provider) }let(:user) { create(:user, identity_url: "#{provider.slug}:me") }- let(:storage) { create(:nextcloud_storage_configured) }- it "must use an SsoUserToken strategy" do- strategy = described_class.call(user:, storage:)- expect(strategy.key).to eq(:sso_user_token)+ context "if file storage is configured for sso only" do+ let(:storage) { create(:nextcloud_storage) }++ it "must use an SsoUserToken strategy" do+ strategy = described_class.call(user:, storage:)+ expect(strategy.key).to eq(:sso_user_token)+ endend- end- context "if file storage is configured for sso and oauth and user is local" do- let(:user) { create(:user) }- let(:storage) { create(:nextcloud_storage_configured) }+ context "if file storage is configured for sso and oauth" do+ let(:storage) { create(:nextcloud_storage_configured) }- it "must use an OAuthUserToken strategy" do- strategy = described_class.call(user:, storage:)- expect(strategy.key).to eq(:oauth_user_token)+ it "must use an SsoUserToken strategy" do+ strategy = described_class.call(user:, storage:)+ expect(strategy.key).to eq(:sso_user_token)+ endend- end- context "if file storage is configured only for oauth and user is provided by an IDP" do- let(:provider) { create(:oidc_provider) }- let(:user) { create(:user, identity_url: "#{provider.slug}:me") }- let(:storage) { create(:nextcloud_storage_configured, nextcloud_audience: nil) }+ context "if file storage is configured for oauth only" do+ let(:storage) { create(:nextcloud_storage_configured, nextcloud_audience: nil) }- it "must use an OAuthUserToken strategy" do- strategy = described_class.call(user:, storage:)- expect(strategy.key).to eq(:oauth_user_token)+ it "must use an OAuthUserToken strategy" do+ strategy = described_class.call(user:, storage:)+ expect(strategy.key).to eq(:oauth_user_token)+ endendend- context "if file storage is configured only for oauth and user is local" do+ context "if user is local" dolet(:user) { create(:user) }- let(:storage) { create(:nextcloud_storage_configured, nextcloud_audience: nil) }- it "must use an OAuthUserToken strategy" do- strategy = described_class.call(user:, storage:)- expect(strategy.key).to eq(:oauth_user_token)+ context "if file storage is configured for sso only" do+ let(:storage) { create(:nextcloud_storage) }++ it "must return the failure strategy" do+ strategy = described_class.call(user:, storage:)+ expect(strategy.key).to eq(:failure)+ end+ end++ context "if file storage is configured for sso and oauth" do+ let(:storage) { create(:nextcloud_storage_configured) }++ it "must use an OAuthUserToken strategy" do+ strategy = described_class.call(user:, storage:)+ expect(strategy.key).to eq(:oauth_user_token)+ end+ end++ context "if file storage is configured for oauth only" do+ let(:storage) { create(:nextcloud_storage_configured, nextcloud_audience: nil) }++ it "must use an OAuthUserToken strategy" do+ strategy = described_class.call(user:, storage:)+ expect(strategy.key).to eq(:oauth_user_token)+ endendenddiff --git a/modules/storages/spec/common/storages/peripherals/storage_interaction/authentication_strategies/sso_user_token_spec.rb b/modules/storages/spec/common/storages/peripherals/storage_interaction/authentication_strategies/sso_user_token_spec.rbindex e00c48648ed..a2e816787a5 100644--- a/modules/storages/spec/common/storages/peripherals/storage_interaction/authentication_strategies/sso_user_token_spec.rb+++ b/modules/storages/spec/common/storages/peripherals/storage_interaction/authentication_strategies/sso_user_token_spec.rb@@ -73,7 +73,6 @@ RSpec.describe Storages::Peripherals::StorageInteraction::AuthenticationStrategiexpect(result.result).to eq(:unauthorized)expect(result.errors).to be_a(Storages::StorageError)expect(result.errors.data).to eq(error)- expect(result.errors.data).to eq(error)endendend