diff options
-rw-r--r-- | spec/registration_spec.rb | 8 | ||||
-rw-r--r-- | spec/spec_helper.rb | 5 |
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 |