Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/diaspora/diaspora.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Neff <benjamin@coding4coffee.ch>2015-05-15 21:34:35 +0300
committerJonne Haß <me@jhass.eu>2015-05-16 14:54:01 +0300
commitd74e20a79072350735e93b9306b52f2145112ce3 (patch)
treeec9c4f019047b3cdadcc545817d73112b877e470 /spec/workers
parent30cc330747958c7111e7d1d4d4887234a42a91be (diff)
fetch public posts when someone starts sharing with you
closes #5960
Diffstat (limited to 'spec/workers')
-rw-r--r--spec/workers/fetch_webfinger_spec.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/workers/fetch_webfinger_spec.rb b/spec/workers/fetch_webfinger_spec.rb
new file mode 100644
index 000000000..cfa83b24a
--- /dev/null
+++ b/spec/workers/fetch_webfinger_spec.rb
@@ -0,0 +1,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(Webfinger).to receive(:new).and_return(double(fetch: @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(Webfinger).to receive(:new).and_return(double(fetch: nil))
+
+ expect(Diaspora::Fetcher::Public).not_to receive(:queue_for)
+
+ Workers::FetchWebfinger.new.perform("unknown-person@example.net")
+ end
+end