summaryrefslogtreecommitdiffstats
path: root/spec/spec_helper.rb
blob: aaf466a203a8990e6d8920866875cfb419d024cf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
ENV['RACK_ENV'] = 'test'

require_relative '../registration'
require_relative 'support/band_factory'
require_relative 'support/contact_factory'
require_relative 'support/submit_form_helper'
require 'capybara/rspec'
require 'rspec-html-matchers'

RSpec.configure do |config|
  config.include BandFactory
  config.include ContactFactory
  config.include SubmitFormHelper
  config.include RSpecHtmlMatchers

  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
  delivery_method :test # in practice you'd do this in spec_helper.rb
end

Capybara.app = RegistrationApp