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
Make sure redirect URI does not show as completed prematurely
Jan Sandbrink21db43568f59
diff --git a/modules/storages/app/components/storages/admin/redirect_uri_component.html.erb b/modules/storages/app/components/storages/admin/redirect_uri_component.html.erbindex 0da51bae0e2..18399c6869b 100644--- a/modules/storages/app/components/storages/admin/redirect_uri_component.html.erb+++ b/modules/storages/app/components/storages/admin/redirect_uri_component.html.erb@@ -7,7 +7,7 @@Primer::Beta::Text.new(font_weight: :bold, mr: 1, test_selector: 'storage-redirect-uri-label')) { I18n.t('storages.file_storage_view.redirect_uri') })- concat(configuration_check_label_for(:storage_oauth_client_configured))+ concat(configuration_check_label_for(:storage_redirect_uri_configured))endgrid.with_area(:description, tag: :div, color: :subtle, test_selector: 'storage-redirect-uri-description') dodiff --git a/modules/storages/app/models/storages/one_drive_storage.rb b/modules/storages/app/models/storages/one_drive_storage.rbindex f215f0079fc..5beade3ee8e 100644--- a/modules/storages/app/models/storages/one_drive_storage.rb+++ b/modules/storages/app/models/storages/one_drive_storage.rb@@ -42,6 +42,7 @@ module Storagesdef configuration_checks{storage_oauth_client_configured: oauth_client.present?,+ storage_redirect_uri_configured: oauth_client&.persisted?,storage_tenant_drive_configured: tenant_id.present? && drive_id.present?,access_management_configured: !automatic_management_unspecified?,name_configured: name.present?diff --git a/modules/storages/spec/models/storages/one_drive_storage_spec.rb b/modules/storages/spec/models/storages/one_drive_storage_spec.rbindex 4660f2033c3..142a76eb8bb 100644--- a/modules/storages/spec/models/storages/one_drive_storage_spec.rb+++ b/modules/storages/spec/models/storages/one_drive_storage_spec.rb@@ -43,16 +43,17 @@ RSpec.describe Storages::OneDriveStorage dodescribe "#configured?" docontext "with a complete configuration" do- let(:storage) { build(:one_drive_storage, :as_not_automatically_managed, oauth_client: build(:oauth_client)) }+ let(:storage) { create(:one_drive_storage, :as_not_automatically_managed, oauth_client: build(:oauth_client)) }it "returns true" do- expect(storage.configured?).to be(true)+ expect(storage).to be_configuredaggregate_failures "configuration_checks" doexpect(storage.configuration_checks).to eq(name_configured: true,storage_oauth_client_configured: true,access_management_configured: true,+ storage_redirect_uri_configured: true,storage_tenant_drive_configured: true)endend@@ -62,10 +63,11 @@ RSpec.describe Storages::OneDriveStorage dolet(:storage) { build(:one_drive_storage) }it "returns false" do- expect(storage.configured?).to be(false)+ expect(storage).not_to be_configuredaggregate_failures "configuration_checks" do- expect(storage.configuration_checks[:storage_oauth_client_configured]).to be(false)+ expect(storage.configuration_checks[:storage_oauth_client_configured]).to be_falsey+ expect(storage.configuration_checks[:storage_redirect_uri_configured]).to be_falseyendendend