From 9a5ef164ba29a8f56b3e2f42edf83d732613738f Mon Sep 17 00:00:00 2001 From: Mark Longair Date: Thu, 9 May 2013 14:19:50 +0100 Subject: Switch to just loading fixtures in tests as binary strings The data loaded with load_file_fixture is generally used in the tests as if it were binary data received from the MTA, so just load it as binary data - in Ruby 1.9 this means that it will end up with the encoding ASCII-8BIT. The same is the case when reading data from a fixture file in receive_incoming_mail. --- spec/support/email_helpers.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'spec/support/email_helpers.rb') diff --git a/spec/support/email_helpers.rb b/spec/support/email_helpers.rb index 7e98c39f6..252b1f137 100644 --- a/spec/support/email_helpers.rb +++ b/spec/support/email_helpers.rb @@ -8,7 +8,7 @@ end def receive_incoming_mail(email_name, email_to, email_from = 'geraldinequango@localhost') email_name = file_fixture_name(email_name) - content = File.read(email_name) + content = File.open(email_name, 'rb') { |f| f.read } content.gsub!('EMAIL_TO', email_to) content.gsub!('EMAIL_FROM', email_from) RequestMailer.receive(content) -- cgit v1.2.3