summaryrefslogtreecommitdiffstats
path: root/spec/registration_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/registration_spec.rb')
-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