Add webfinger_discovery_request to resolve account service spec

This commit is contained in:
Matt Jankowski 2024-09-23 10:12:18 -04:00
parent c36a76b9eb
commit b9ef094f36

View File

@ -28,7 +28,7 @@ RSpec.describe ResolveAccountService do
it 'does not make a webfinger query' do
subject.call('foo@ap.example.com', skip_webfinger: true)
expect(a_request(:get, 'https://ap.example.com/.well-known/webfinger?resource=acct:foo@ap.example.com')).to_not have_been_made
expect(webfinger_discovery_request).to_not have_been_made
end
end
@ -39,7 +39,7 @@ RSpec.describe ResolveAccountService do
it 'does not make a webfinger query' do
subject.call('foo@ap.example.com', skip_webfinger: true)
expect(a_request(:get, 'https://ap.example.com/.well-known/webfinger?resource=acct:foo@ap.example.com')).to_not have_been_made
expect(webfinger_discovery_request).to_not have_been_made
end
end
end
@ -51,9 +51,16 @@ RSpec.describe ResolveAccountService do
it 'does not make a webfinger query' do
subject.call('foo@ap.example.com', skip_webfinger: true)
expect(a_request(:get, 'https://ap.example.com/.well-known/webfinger?resource=acct:foo@ap.example.com')).to_not have_been_made
expect(webfinger_discovery_request).to_not have_been_made
end
end
def webfinger_discovery_request
a_request(
:get,
'https://ap.example.com/.well-known/webfinger?resource=acct:foo@ap.example.com'
)
end
end
context 'when there is an LRDD endpoint but no resolvable account' do