mirror of
https://github.com/opf/openproject.git
synced 2026-06-14 03:30:14 +00:00
Clean up a bit
This commit is contained in:
@@ -31,13 +31,15 @@
|
||||
module Wikis
|
||||
module XWikiProviders
|
||||
class FetchInstanceIdService
|
||||
attr_reader :provider
|
||||
|
||||
def initialize(provider:)
|
||||
@provider = provider
|
||||
end
|
||||
|
||||
def call
|
||||
auth_strategy = @provider.resolve("authentication.noop").call.value!
|
||||
@provider.resolve("queries.instance_id").call(auth_strategy:)
|
||||
auth_strategy = provider.resolve("authentication.noop").call.value!
|
||||
provider.resolve("queries.instance_id").call(auth_strategy:)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
+1
-2
@@ -41,9 +41,8 @@ RSpec.describe Wikis::Adapters::Providers::XWiki::Queries::InstanceId, :disable_
|
||||
let(:wiki_provider) { create(:xwiki_provider, :for_local_connection, connected_user: user) }
|
||||
let(:metadata_url) { "https://xwiki.local/rest/openproject/metadata" }
|
||||
let(:auth_strategy) { Wikis::Adapters::Input::AuthStrategy.build(key: :noop).value! }
|
||||
let(:query) { described_class.new(model: wiki_provider) }
|
||||
|
||||
subject(:result) { query.call(auth_strategy:) }
|
||||
subject(:result) { described_class.new(model: wiki_provider).call(auth_strategy:) }
|
||||
|
||||
context "when the request succeeds", vcr: "xwiki/instance_id" do
|
||||
it "returns Success with the instance id" do
|
||||
|
||||
Reference in New Issue
Block a user