diff options
author | Thorsten Claus <thorstenclaus@web.de> | 2021-07-17 18:39:20 +0300 |
---|---|---|
committer | Benjamin Neff <benjamin@coding4coffee.ch> | 2021-08-16 01:24:33 +0300 |
commit | 8691e650dc726fb929df33409475594111b231da (patch) | |
tree | 958b301fe4cf406b2d66a593d803de3eae773e8c /spec/workers | |
parent | 20a3abd86443365b2b4f8f63b1a1ab32389a29b2 (diff) |
Person.find_or_fetch_by_identifier never return nil
Person.find_or_fetch_by_identifier raises an exception if person is not found localy and not fetchable. It never returns nil. These code changes take care about this behaviour and changes specs and code to behave equally.
Also related to #8253
Diffstat (limited to 'spec/workers')
-rw-r--r-- | spec/workers/fetch_webfinger_spec.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/spec/workers/fetch_webfinger_spec.rb b/spec/workers/fetch_webfinger_spec.rb index 234c7d215..3ed3e4ffa 100644 --- a/spec/workers/fetch_webfinger_spec.rb +++ b/spec/workers/fetch_webfinger_spec.rb @@ -11,7 +11,7 @@ describe Workers::FetchWebfinger do end it "should webfinger and queue no job to fetch public posts if the person is not found" do - allow(Person).to receive(:find_or_fetch_by_identifier).and_return(nil) + allow(Person).to receive(:find_or_fetch_by_identifier).and_raise DiasporaFederation::Discovery::DiscoveryError expect(Diaspora::Fetcher::Public).not_to receive(:queue_for) |