summaryrefslogtreecommitdiffstats
path: root/spec/registration_spec.rb
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2015-10-03 18:46:37 +0200
committerHarald Eilertsen <haraldei@anduin.net>2015-10-04 11:42:03 +0200
commit1f63803e7bdac1abe4219e98a1a7bd84529ec144 (patch)
tree16decb05b424158b171633b703841ab94cc18ecc /spec/registration_spec.rb
parent1c48f48073e33875650b687ced05a51e0fd7f7d3 (diff)
downloadnorsk-urskog-registrations-1f63803e7bdac1abe4219e98a1a7bd84529ec144.tar.gz
norsk-urskog-registrations-1f63803e7bdac1abe4219e98a1a7bd84529ec144.tar.bz2
norsk-urskog-registrations-1f63803e7bdac1abe4219e98a1a7bd84529ec144.zip
Send email to Norsk Urskog when a band is registered.
Diffstat (limited to 'spec/registration_spec.rb')
-rw-r--r--spec/registration_spec.rb13
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