summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2015-10-06 19:42:47 +0200
committerHarald Eilertsen <haraldei@anduin.net>2015-10-06 19:42:47 +0200
commit9977cd680abe084232e87d818522672085757afd (patch)
treeda341cea2efb1909e016702e509b79e71b84e6dc /spec
parentf519e2eaa5cc4fb04262642aca936bc7b826c893 (diff)
downloadnorsk-urskog-registrations-9977cd680abe084232e87d818522672085757afd.tar.gz
norsk-urskog-registrations-9977cd680abe084232e87d818522672085757afd.tar.bz2
norsk-urskog-registrations-9977cd680abe084232e87d818522672085757afd.zip
Move Prawn spy out to spec_helper.
This stubs out the actual calls to prawn in all examples in the spec. We don't want to generate spurious PDF's during testing.
Diffstat (limited to 'spec')
-rw-r--r--spec/registration_spec.rb8
-rw-r--r--spec/spec_helper.rb5
2 files changed, 5 insertions, 8 deletions
diff --git a/spec/registration_spec.rb b/spec/registration_spec.rb
index d76d59e..6532f3e 100644
--- a/spec/registration_spec.rb
+++ b/spec/registration_spec.rb
@@ -39,10 +39,6 @@ describe RegistrationApp do
context 'with a valid registration' do
before :each do
- @doc_spy = spy("Prawn::Document")
- allow(Prawn::Document).to receive('new') { @doc_spy }
- allow(@doc_spy).to receive('render_file')
-
post '/submit', 'band' => create_band_params
end
@@ -88,10 +84,6 @@ describe RegistrationApp do
context 'with no songs' do
before :each do
- @doc_spy = spy("Prawn::Document")
- allow(Prawn::Document).to receive('new') { @doc_spy }
- allow(@doc_spy).to receive('render_file')
-
post '/submit', 'band' => create_band_params(:songs => 0)
end
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 0b78dfd..62fd2d1 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -9,6 +9,11 @@ require 'capybara/rspec'
RSpec.configure do |config|
config.include BandFactory
+ config.before(:example) do
+ @doc_spy = spy("Prawn::Document")
+ allow(Prawn::Document).to receive('new') { @doc_spy }
+ allow(@doc_spy).to receive('render_file')
+ end
end
Mail.defaults do