2013-06-14 06:11:10 +08:00
|
|
|
require 'spec_helper'
|
2013-10-01 15:04:02 +08:00
|
|
|
require_dependency 'jobs/regular/process_post'
|
2013-06-14 06:11:10 +08:00
|
|
|
|
|
|
|
describe Jobs::PollMailbox do
|
|
|
|
|
|
|
|
|
|
|
|
let(:poller) { Jobs::PollMailbox.new }
|
|
|
|
|
|
|
|
it "does no polling if pop3s_polling_enabled is false" do
|
|
|
|
SiteSetting.expects(:pop3s_polling_enabled?).returns(false)
|
|
|
|
poller.expects(:poll_pop3s).never
|
|
|
|
poller.execute({})
|
|
|
|
end
|
|
|
|
|
|
|
|
describe "with pop3s_polling_enabled" do
|
|
|
|
|
|
|
|
it "calls poll_pop3s" do
|
|
|
|
SiteSetting.expects(:pop3s_polling_enabled?).returns(true)
|
|
|
|
poller.expects(:poll_pop3s).once
|
|
|
|
poller.execute({})
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|