blob: 0a9469c75d7304d01de45631e8e3da723e540758 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
require "spec_helper"
describe Workers::FetchWebfinger do
it "should webfinger and queue a job to fetch public posts" do
@person = FactoryGirl.create(:person)
allow(Person).to receive(:find_or_fetch_by_identifier).and_return(@person)
expect(Diaspora::Fetcher::Public).to receive(:queue_for).exactly(1).times
Workers::FetchWebfinger.new.perform(@person.diaspora_handle)
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)
expect(Diaspora::Fetcher::Public).not_to receive(:queue_for)
Workers::FetchWebfinger.new.perform("unknown-person@example.net")
end
end
|