aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/fixtures/psni.pdfbin0 -> 48057 bytes
-rw-r--r--spec/models/incoming_message_spec.rb7
2 files changed, 7 insertions, 0 deletions
diff --git a/spec/fixtures/psni.pdf b/spec/fixtures/psni.pdf
new file mode 100644
index 000000000..daca3f4ec
--- /dev/null
+++ b/spec/fixtures/psni.pdf
Binary files differ
diff --git a/spec/models/incoming_message_spec.rb b/spec/models/incoming_message_spec.rb
index 0cfdeac3a..35e9b3a2b 100644
--- a/spec/models/incoming_message_spec.rb
+++ b/spec/models/incoming_message_spec.rb
@@ -174,6 +174,13 @@ describe IncomingMessage, " when censoring data" do
masked_text.should match(/xxx@xxx.xxx.xx/)
end
+ it "should not produce zero length output if pdftk silently fails" do
+ orig_pdf = load_file_fixture('psni.pdf')
+ pdf = orig_pdf.dup
+ @im.binary_mask_stuff!(pdf, "application/pdf")
+ pdf.should_not == ""
+ end
+
it "should apply censor rules to HTML files" do
data = @test_data.dup
@im.html_mask_stuff!(data)