mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-22 21:42:27 -05:00
a78df3d57d
Feature to allow each imported post to be created using a different discourse username. A possible use case of this is a multi-author blog where discourse is being used to track comments. This feature allows authors to receive updates when someone leaves a comment on one of their articles because each of the imported posts can be created using the discourse username of the author.
33 lines
960 B
Ruby
33 lines
960 B
Ruby
require 'spec_helper'
|
|
require_dependency 'jobs/regular/process_post'
|
|
|
|
describe Jobs::PollFeed do
|
|
let(:poller) { Jobs::PollFeed.new }
|
|
|
|
context "execute" do
|
|
let(:url) { "http://eviltrout.com" }
|
|
let(:embed_by_username) { "eviltrout" }
|
|
|
|
it "requires feed_polling_enabled?" do
|
|
SiteSetting.stubs(:feed_polling_enabled?).returns(true)
|
|
SiteSetting.stubs(:feed_polling_url).returns(nil)
|
|
poller.expects(:poll_feed).never
|
|
poller.execute({})
|
|
end
|
|
|
|
it "requires feed_polling_url" do
|
|
SiteSetting.stubs(:feed_polling_enabled?).returns(false)
|
|
SiteSetting.stubs(:feed_polling_url).returns(nil)
|
|
poller.expects(:poll_feed).never
|
|
poller.execute({})
|
|
end
|
|
|
|
it "delegates to poll_feed" do
|
|
SiteSetting.stubs(:feed_polling_enabled?).returns(true)
|
|
SiteSetting.stubs(:feed_polling_url).returns(url)
|
|
poller.expects(:poll_feed).once
|
|
poller.execute({})
|
|
end
|
|
end
|
|
|
|
end
|