diff options
author | Louise Crow <louise.crow@gmail.com> | 2015-04-16 15:28:57 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2015-04-16 15:28:57 +0100 |
commit | ec675fd07b8a80fc16ac5b02c49467c1a51b4fc5 (patch) | |
tree | 3d16f3656aac92db33350bb4fe5fa99e3fe1cd6f /spec/lib | |
parent | 0befd8662160a7373aaec474dee2830620500180 (diff) | |
parent | 8e8f9e4e1f3d965923aa31d2720fdde712e9aa86 (diff) |
Merge branch 'fix-text-masker-logger-call' into rails-3-develop
Diffstat (limited to 'spec/lib')
-rw-r--r-- | spec/lib/alaveteli_text_masker_spec.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/lib/alaveteli_text_masker_spec.rb b/spec/lib/alaveteli_text_masker_spec.rb index 1a4782a83..102d2582e 100644 --- a/spec/lib/alaveteli_text_masker_spec.rb +++ b/spec/lib/alaveteli_text_masker_spec.rb @@ -92,6 +92,23 @@ describe AlaveteliTextMasker do pdf.should_not == "" end + it 'should keep the uncensored original if uncompression of a PDF fails' do + orig_pdf = load_file_fixture('tfl.pdf') + pdf = orig_pdf.dup + stub!(:uncompress_pdf).and_return nil + apply_masks!(pdf, "application/pdf") + pdf.should == orig_pdf + end + + it 'should use the uncompressed PDF text if re-compression of a compressed PDF fails' do + orig_pdf = load_file_fixture('tfl.pdf') + pdf = orig_pdf.dup + stub!(:uncompress_pdf).and_return "something about foi@tfl.gov.uk" + stub!(:compress_pdf).and_return nil + apply_masks!(pdf, "application/pdf") + pdf.should match "something about xxx@xxx.xxx.xx" + end + it "should apply hard-coded privacy rules to HTML files" do data = "http://test.host/c/cheese" apply_masks!(data, 'text/html') |