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
[#43527] Renaming a storage leads to wrong name of attached OAuth application
Andreas Pfohlda447660249e
diff --git a/modules/storages/app/services/storages/storages/update_service.rb b/modules/storages/app/services/storages/storages/update_service.rbindex 055fd08cc7f..31311b44c96 100644--- a/modules/storages/app/services/storages/storages/update_service.rb+++ b/modules/storages/app/services/storages/storages/update_service.rb@@ -40,7 +40,7 @@ module Storages::Storagespersist_service_result = ::OAuth::PersistApplicationService.new(application, user:).call({- name: "#{storage.name} (#{I18n.t("storages.provider_types.#{storage.provider_type}")})",+ name: "#{storage.name} (#{I18n.t("storages.provider_types.#{storage.provider_type}.name")})",redirect_uri: File.join(storage.host, "apps/integration_openproject/oauth-redirect")})service_call.add_dependent!(persist_service_result)diff --git a/modules/storages/spec/services/storages/storages/update_service_spec.rb b/modules/storages/spec/services/storages/storages/update_service_spec.rbindex 390978df0b3..610f7e34965 100644--- a/modules/storages/spec/services/storages/storages/update_service_spec.rb+++ b/modules/storages/spec/services/storages/storages/update_service_spec.rb@@ -76,4 +76,21 @@ describe ::Storages::Storages::UpdateService, type: :model doexpect(service_result.errors.symbols_for(:creator_id)).to contain_exactly(:error_readonly)expect(storage.reload.creator).to eq(storage_creator)end++ describe 'updates the nested OAuth application' do+ let(:storage) { create(:storage) }+ let!(:oauth_application) { create(:oauth_application, integration: storage) }+ let(:user) { create(:admin) }+ let(:name) { 'Awesome Storage' }++ subject do+ described_class+ .new(user:, model: storage)+ .call({ name: })+ end++ it 'must update the name of the OAuth application' do+ expect(subject.result.oauth_application.name).to eq("#{name} (#{storage.provider_type.to_s.capitalize})")+ end+ endend