Merge pull request #2647 from riking/multiple-addresses

Allow processing of email sent to multiple addresses
This commit is contained in:
Sam
2014-08-22 10:32:42 +10:00
17 changed files with 117 additions and 42 deletions

View File

@@ -167,8 +167,21 @@ describe Jobs::PollMailbox do
email.should be_deleted
end
it "works with multiple To addresses" do
email = MockPop3EmailObject.new fixture_file('emails/multiple_destinations.eml')
expect_success
poller.handle_mail(email)
new_post = Post.find_by(topic: topic, post_number: 2)
assert new_post.present?
assert_equal expected_post.strip, new_post.cooked.strip
email.should be_deleted
end
describe "with the wrong reply key" do
let(:email) { MockPop3EmailObject.new fixture_file('emails/wrong_reply_key.eml')}
let(:email) { MockPop3EmailObject.new fixture_file('emails/wrong_reply_key.eml') }
it "raises an EmailLogNotFound error" do
expect_exception Email::Receiver::EmailLogNotFound