aboutsummaryrefslogtreecommitdiffstats
path: root/spec/lib/attachment_to_html
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2015-02-12 17:29:20 +0000
committerLouise Crow <louise.crow@gmail.com>2015-02-13 10:18:17 +0000
commitbee52d71bf1f5a2178afab5a78f8de7ddbefda42 (patch)
tree96c381ced00396c544ef6404e1368eb0b466d5cf /spec/lib/attachment_to_html
parentf7d7d92e981431d9b068fb379c5d21b49c67f6c8 (diff)
Set binary mode to false in call to pdftohtml
We want the HTML to be encoding in the default encoding so that it can be combined with other strings.
Diffstat (limited to 'spec/lib/attachment_to_html')
-rw-r--r--spec/lib/attachment_to_html/adapters/pdf_spec.rb17
1 files changed, 15 insertions, 2 deletions
diff --git a/spec/lib/attachment_to_html/adapters/pdf_spec.rb b/spec/lib/attachment_to_html/adapters/pdf_spec.rb
index da79b2de0..f1ae4695c 100644
--- a/spec/lib/attachment_to_html/adapters/pdf_spec.rb
+++ b/spec/lib/attachment_to_html/adapters/pdf_spec.rb
@@ -15,7 +15,7 @@ describe AttachmentToHTML::Adapters::PDF do
adapter = AttachmentToHTML::Adapters::PDF.new(attachment, :tmpdir => '/tmp')
adapter.tmpdir.should == '/tmp'
end
-
+
end
describe :title do
@@ -23,7 +23,14 @@ describe AttachmentToHTML::Adapters::PDF do
it 'uses the attachment filename for the title' do
adapter.title.should == attachment.display_filename
end
-
+
+ it 'returns the title encoded as UTF-8' do
+ if RUBY_VERSION.to_f >= 1.9
+ adapter.title.encoding.should == Encoding.find('UTF-8')
+ end
+ end
+
+
end
describe :body do
@@ -38,6 +45,12 @@ describe AttachmentToHTML::Adapters::PDF do
adapter.body
end
+ it 'returns the body encoded as UTF-8' do
+ if RUBY_VERSION.to_f >= 1.9
+ adapter.body.encoding.should == Encoding.find('UTF-8')
+ end
+ end
+
end