discourse/spec/jobs/poll_mailbox_spec.rb
Sam f0a122a66c move job files so they live underneath app/ and not in lib/
introduce new setting email_always, that will force emails to send to users regardless of presence on site
2013-10-01 17:04:02 +10:00

25 lines
557 B
Ruby

require 'spec_helper'
require_dependency 'jobs/regular/process_post'
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