aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2015-06-25 12:10:33 +0100
committerLouise Crow <louise.crow@gmail.com>2015-06-25 12:10:33 +0100
commit86b5feb588b84b1d815565d13e0e0d3faba9ba39 (patch)
tree07bda2dadd166c4cc91933c2af35a0fdfc1529dc /spec
parent34a1bc6b32d5a1e61bd4f23be72372b8b081185e (diff)
parentf031b9881a197539f0a33ffc0188cc6b8f98bb3e (diff)
Merge branch 'hotfix/0.21.0.40'HEAD0.21.0.40master
Diffstat (limited to 'spec')
-rw-r--r--spec/fixtures/files/russian.email40
-rw-r--r--spec/script/handle-mail-replies_spec.rb21
2 files changed, 56 insertions, 5 deletions
diff --git a/spec/fixtures/files/russian.email b/spec/fixtures/files/russian.email
new file mode 100644
index 000000000..6e33b1b46
--- /dev/null
+++ b/spec/fixtures/files/russian.email
@@ -0,0 +1,40 @@
+Message-ID: <558BB884.2010504@whatdotheyknow.com>
+Date: Thu, 25 Jun 2015 09:15:00 +0100
+From: xx <xx@xx.com>
+Reply-To: xx@xx.com
+User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0
+MIME-Version: 1.0
+To: test@example.com <test@example.com>
+CC: xx <xx@xx.com>
+Subject: Re: =?UTF-8?B?0JLQsNGIINGB0LDQudGC?=
+References: <558bb6f371205_72da364cd0c4353@titan.mail>
+In-Reply-To: <558bb6f371205_72da364cd0c4353@titan.mail>
+Content-Type: text/plain; charset=utf-8; format=flowed
+Content-Transfer-Encoding: 8bit
+
+Уважаемая Оксана Позднякова,
+
+спасибо за ваше письмо. Относительно вашего вопроса, в России есть сайт
+РосОтвет - http://rosotvet.ru/
+
+РосОтвет некоммерческий сервис для отправки запросов на получение
+информации о деятельности органов власти. Вы заполняете форму, указывая,
+какая информация вас интересует и Юристы проекта оформляют вашу заявку
+как юридически грамотный запрос, выбирая релевантный орган власти. Они
+отправляют запрос от нашего имени потому, что они СМИ. Сейчас в сайте
+есть 370 запросов и 254 ответов.
+
+С уважением,
+
+Хелень Крос
+---------
+Helen - WhatDoTheyKnow.com volunteer.
+
+
+On 25/06/2015 09:08, Оксана Позднякова wrote:
+> B россии есть подобный сайт?
+>
+> ---------------------------------------------------------------------
+> Message sent using WhatDoTheyKnow contact form,
+> not logged in ---------------------------------------------------------------------
+
diff --git a/spec/script/handle-mail-replies_spec.rb b/spec/script/handle-mail-replies_spec.rb
index 62d5c1dab..72914e517 100644
--- a/spec/script/handle-mail-replies_spec.rb
+++ b/spec/script/handle-mail-replies_spec.rb
@@ -12,11 +12,22 @@ def mail_reply_test(email_filename)
end
describe "When filtering" do
- it "should not fail when not in test mode" do
- xc = ExternalCommand.new("script/handle-mail-replies",
- { :stdin_string => load_file_fixture("track-response-exim-bounce.email") })
- xc.run
- xc.err.should == ""
+
+ describe "when not in test mode" do
+
+ it "should not fail handling a bounce mail" do
+ xc = ExternalCommand.new("script/handle-mail-replies",
+ { :stdin_string => load_file_fixture("track-response-exim-bounce.email") })
+ xc.run
+ xc.err.should == ""
+ end
+
+ it 'should not fail handling a UTF8 encoded mail' do
+ xc = ExternalCommand.new("script/handle-mail-replies",
+ { :stdin_string => load_file_fixture("russian.email") })
+ xc.run
+ xc.err.should == ""
+ end
end
it "should detect an Exim bounce" do