diff options
Diffstat (limited to 'spec')
-rw-r--r-- | spec/registration_spec.rb | 12 |
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') |