summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2015-10-04 12:42:56 +0200
committerHarald Eilertsen <haraldei@anduin.net>2015-10-04 12:59:11 +0200
commit448380ae81e3dfe182b9092880d4a314b39d034a (patch)
treeee5f34a250f2710d7decb732de8e832f69259146 /spec
parent1f63803e7bdac1abe4219e98a1a7bd84529ec144 (diff)
downloadnorsk-urskog-registrations-448380ae81e3dfe182b9092880d4a314b39d034a.tar.gz
norsk-urskog-registrations-448380ae81e3dfe182b9092880d4a314b39d034a.tar.bz2
norsk-urskog-registrations-448380ae81e3dfe182b9092880d4a314b39d034a.zip
Add dummy method to generate PDF from registration data.
Diffstat (limited to 'spec')
-rw-r--r--spec/registration_spec.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/spec/registration_spec.rb b/spec/registration_spec.rb
index ed95fae..c8858cc 100644
--- a/spec/registration_spec.rb
+++ b/spec/registration_spec.rb
@@ -1,3 +1,5 @@
+require "prawn"
+
describe RegistrationApp do
include Rack::Test::Methods
@@ -76,6 +78,10 @@ describe RegistrationApp do
}
}
}
+
+ class_spy("Prawn::Document")
+ allow(Prawn::Document).to receive('generate')
+
post '/submit', 'band' => params
end
@@ -106,7 +112,11 @@ describe RegistrationApp do
expect(last_response).to match /Merknad: Rævrukkje rum kjurr!/
end
- it 'sends and email to Norsk Urskog' do
+ it "generates a PDF file" do
+ expect(Prawn::Document).to have_received('generate').with("Imbalance.pdf")
+ end
+
+ it 'sends an email to Norsk Urskog' do
message = Mail::TestMailer.deliveries.first
expect(Mail::TestMailer.deliveries).not_to be_empty
expect(message.to).to include('haraldei@anduin.net')