Refactor AdminNotifier.
authorWard Vandewege <ward@curoverse.com>
Fri, 25 Apr 2014 15:38:48 +0000 (11:38 -0400)
committerWard Vandewege <ward@curoverse.com>
Tue, 6 May 2014 15:10:14 +0000 (11:10 -0400)
commit1eee45ce0bbae9e7d04a9382469d2c48fb0cfd3e
treebef2bf57a952111b45009824a75402df7e3e7f96
parent89851a28f3bd8dc05bb8efcab86fa42dda7e7fd2
Refactor AdminNotifier.

The old implementation was elegant, but not super useful in the
situation where you want to send different e-mails from a method.

Due to the way ActiveMailer is implemented, Rails would reuse the
Mail::Message object for sending the messages, which makes this
impossible to test.

So... I threw out the fancy solution in favor of something that also
works and can be tested fully.

I also added a number of tests.
services/api/app/mailers/admin_notifier.rb
services/api/app/models/user.rb
services/api/app/views/admin_notifier/after_create_user.text.erb [deleted file]
services/api/app/views/admin_notifier/new_user.text.erb [new file with mode: 0644]
services/api/config/application.default.yml
services/api/test/unit/user_test.rb