summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2015-11-01 14:50:19 +0100
committerHarald Eilertsen <haraldei@anduin.net>2015-11-01 14:50:19 +0100
commitf8474216b3c4aa9aad4db2b275fe7d26bd42d074 (patch)
tree3aeaa34411fb4a7f2064f50b1eb93f72e6e198f9 /spec
parentef9996515099b8aa04df83080404dcff8badd85c (diff)
downloadnorsk-urskog-registrations-f8474216b3c4aa9aad4db2b275fe7d26bd42d074.tar.gz
norsk-urskog-registrations-f8474216b3c4aa9aad4db2b275fe7d26bd42d074.tar.bz2
norsk-urskog-registrations-f8474216b3c4aa9aad4db2b275fe7d26bd42d074.zip
Include full url in sent email.
Diffstat (limited to 'spec')
-rw-r--r--spec/registration_spec.rb17
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