diff options
Diffstat (limited to 'spec')
-rw-r--r-- | spec/registration_spec.rb | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/spec/registration_spec.rb b/spec/registration_spec.rb index 9bbf477..3111ebc 100644 --- a/spec/registration_spec.rb +++ b/spec/registration_spec.rb @@ -71,11 +71,18 @@ describe RegistrationApp do expect(@doc_spy).to have_received('render_file').with(/uploads\/[0-9]{4}-[0-9]{2}-[0-9]{2}-#{band_params['name']}-#{band_params['city']}\.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') - expect(message.subject).to match(/Registrering av band #{band_params['name']} til Norsk Urskog/) + describe 'sends an email to Norsk Urskog' do + let(:message) { Mail::TestMailer.deliveries.first } + + it 'sends an email to Norsk Urskog' do + expect(Mail::TestMailer.deliveries).not_to be_empty + expect(message.to).to include('haraldei@anduin.net') + expect(message.subject).to match(/Registrering av band #{band_params['name']} til Norsk Urskog/) + end + + it 'contains the url to the pdf file' do + expect(message.body).to match(/example.org\/uploads\/[0-9]{4}-[0-9]{2}-[0-9]{2}-#{band_params['name']}-#{band_params['city']}\.pdf/) + end end end |