diff options
Diffstat (limited to 'spec/registration_spec.rb')
-rw-r--r-- | spec/registration_spec.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/registration_spec.rb b/spec/registration_spec.rb index 5f398c0..ed95fae 100644 --- a/spec/registration_spec.rb +++ b/spec/registration_spec.rb @@ -28,6 +28,12 @@ describe RegistrationApp do end describe 'POST submit' do + include Mail::Matchers + + before :each do + Mail::TestMailer.deliveries.clear + end + context 'with a valid registration' do before :each do params = { @@ -99,6 +105,13 @@ describe RegistrationApp do expect(last_response).to match /Låtskrivere: Harald Eilertsen, Thormod Steinert/ expect(last_response).to match /Merknad: Rævrukkje rum kjurr!/ end + + it 'sends and 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 Imbalance til Norsk Urskog/ + end end end end |