Skip to content
Newer
Older
100644 22 lines (18 sloc) 588 Bytes
14016b5 @jonmagic Upload a PDF and then search thru archived PDFs.
authored
1 require 'spec_helper'
2
3 describe ProcessPdf do
4 let(:document) { Document.create(:pdf => pdf_fixture('onepage.pdf')) }
5
6 describe ".perform" do
1627204 @jonmagic Refactored to decouple and make easier reading.
authored
7 it "calls create_preview on pdf" do
8 PdfUploader.any_instance.should_receive(:create_preview)
14016b5 @jonmagic Upload a PDF and then search thru archived PDFs.
authored
9 ProcessPdf.perform(document.id)
10 end
11
1627204 @jonmagic Refactored to decouple and make easier reading.
authored
12 it "extracts text from pages" do
13 Grim::Page.any_instance.should_receive(:text)
14 ProcessPdf.perform(document.id)
14016b5 @jonmagic Upload a PDF and then search thru archived PDFs.
authored
15 end
16
17 it "creates search terms for hunt" do
1627204 @jonmagic Refactored to decouple and make easier reading.
authored
18 ProcessPdf.perform(document.id)
19 document.reload.searches['default'].length.should > 0
14016b5 @jonmagic Upload a PDF and then search thru archived PDFs.
authored
20 end
21 end
22 end
Something went wrong with that request. Please try again.