Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

32 lines (25 sloc) 1.005 kB
describe Jester::IncomingMailDaemon do
include MailTestHelpers
let(:funny_story) { read_email("funny_story") }
let(:interesting_story) { read_email("interesting_story") }
let(:mail_array) { [ funny_story, interesting_story ] }
let(:fake_mail_server) { fake_server(mail_array) }
let(:daemon) { Jester::IncomingMailDaemon.new(fake_mail_server) }
describe "respond_to_all_new_requests" do
it "should pass a response object to the mail server for each request" do
fake_mail_server.should_receive(:deliver_message).with(
instance_of(Jester::Request::Response)).exactly(mail_array.count).times
daemon.respond_to_all_new_requests
end
end
describe "execute_new_requests" do
it "should return an array" do
daemon.execute_new_requests.should be_a Array
end
it "should have a response object for each item" do
daemon.execute_new_requests.each do |response|
response.should be_a Jester::Request::Response
end
end
end
end
Jump to Line
Something went wrong with that request. Please try again.