Skip to content

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

Fix merge conflict (#16402)

Marcello Rocha1f3fae785b50
diff --git a/app/services/remote_identities/create_service.rb b/app/services/remote_identities/create_service.rb
index 4d77f41c23b..21d3dae439d 100644
--- a/app/services/remote_identities/create_service.rb
+++ b/app/services/remote_identities/create_service.rb
@@ -45,7 +45,11 @@ module RemoteIdentities
def call
@model.origin_user_id = @oauth_config.extract_origin_user_id(@oauth_token)
- @result.success = false unless @model.save
+ if @model.save
+ emit_event(@oauth_config.oauth_client.integration)
+ else
+ @result.success = false
+ end
@result
end
diff --git a/spec/services/oauth_clients/connection_manager_spec.rb b/spec/services/oauth_clients/connection_manager_spec.rb
index 1150ba49784..8ccc672660b 100644
--- a/spec/services/oauth_clients/connection_manager_spec.rb
+++ b/spec/services/oauth_clients/connection_manager_spec.rb
@@ -2,7 +2,7 @@
#-- copyright
# OpenProject is an open source project management software.
-# Copyright (C) 2012-2024 the OpenProject GmbH
+# Copyright (C) the OpenProject GmbH
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
@@ -522,11 +522,13 @@ RSpec.describe OAuthClients::ConnectionManager, :webmock, type: :model do
end
it "returns a ServiceResult with success, without refresh" do
- expect(subject.success).to be_truthy
- expect(subject).to be yield_service_result2
- expect(instance).to have_received(:refresh_token)
- expect(oauth_client_token).to have_received(:reload)
- expect(yield_double_object).to have_received(:yield_twice_method).twice
+ without_partial_double_verification do
+ expect(subject.success).to be_truthy
+ expect(subject).to be yield_service_result2
+ expect(instance).to have_received(:refresh_token)
+ expect(oauth_client_token).to have_received(:reload)
+ expect(yield_double_object).to have_received(:yield_twice_method).twice
+ end
end
end
end