Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 25 lines (21 sloc) 0.764 kb
14016b57 »
2011-10-09 Upload a PDF and then search thru archived PDFs.
1 require 'spec_helper'
2
3 describe ProcessPdf do
4 let(:document) { Document.create(:pdf => pdf_fixture('onepage.pdf')) }
5
6 describe ".perform" do
16272048 »
2011-10-13 Refactored to decouple and make easier reading.
7 it "calls create_preview on pdf" do
c877042f »
2011-10-21 Add a PreviewStore for the preview image.
8 document.pdf.cache_stored_file!
9 output_path = File.join(document.pdf.cache_dir, 'preview.jpg')
10 document.pdf.grim[0].save(output_path)
11 PdfUploader.any_instance.should_receive(:create_preview).and_return(output_path)
14016b57 »
2011-10-09 Upload a PDF and then search thru archived PDFs.
12 ProcessPdf.perform(document.id)
13 end
14
16272048 »
2011-10-13 Refactored to decouple and make easier reading.
15 it "extracts text from pages" do
16 Grim::Page.any_instance.should_receive(:text)
17 ProcessPdf.perform(document.id)
14016b57 »
2011-10-09 Upload a PDF and then search thru archived PDFs.
18 end
19
20 it "creates search terms for hunt" do
16272048 »
2011-10-13 Refactored to decouple and make easier reading.
21 ProcessPdf.perform(document.id)
22 document.reload.searches['default'].length.should > 0
14016b57 »
2011-10-09 Upload a PDF and then search thru archived PDFs.
23 end
24 end
25 end
Something went wrong with that request. Please try again.