summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2015-10-04 14:42:15 +0200
committerHarald Eilertsen <haraldei@anduin.net>2015-10-04 14:42:50 +0200
commitd1c061f1aee62c83e21fb5bf7b26901ab8c12af4 (patch)
treeaa223229555efd4225e097dd901f61762af39c98 /spec
parent448380ae81e3dfe182b9092880d4a314b39d034a (diff)
downloadnorsk-urskog-registrations-d1c061f1aee62c83e21fb5bf7b26901ab8c12af4.tar.gz
norsk-urskog-registrations-d1c061f1aee62c83e21fb5bf7b26901ab8c12af4.tar.bz2
norsk-urskog-registrations-d1c061f1aee62c83e21fb5bf7b26901ab8c12af4.zip
Flesh out PDF generation.
Diffstat (limited to 'spec')
-rw-r--r--spec/registration_spec.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/spec/registration_spec.rb b/spec/registration_spec.rb
index c8858cc..2911f6a 100644
--- a/spec/registration_spec.rb
+++ b/spec/registration_spec.rb
@@ -79,8 +79,9 @@ describe RegistrationApp do
}
}
- class_spy("Prawn::Document")
- allow(Prawn::Document).to receive('generate')
+ @doc_spy = spy("Prawn::Document")
+ allow(Prawn::Document).to receive('new') { @doc_spy }
+ allow(@doc_spy).to receive('render_file')
post '/submit', 'band' => params
end
@@ -113,7 +114,8 @@ describe RegistrationApp do
end
it "generates a PDF file" do
- expect(Prawn::Document).to have_received('generate').with("Imbalance.pdf")
+ expect(Prawn::Document).to have_received('new').with({ :page_size => "A4" })
+ expect(@doc_spy).to have_received('render_file').with("Imbalance.pdf")
end
it 'sends an email to Norsk Urskog' do