require 'spec_helper' describe Medivo::PdfGenerator do it "#variable_fields generates pdf by filling in the variables" do name = "Duderoni" path = "#{ENGINE_PATH}/spec/fixtures/negative_results.pdf" pdf_file = Medivo::PdfGenerator.variable_fields(path, {:patient_name=>name}) text = pdf_to_text(pdf_file.read) text.should =~ /#{name}/ end end