[ARVADOS] updated: 9bb0d7674485783477d428f0deafeb3eb2324305

git at public.curoverse.com git at public.curoverse.com
Sat Aug 23 15:20:50 EDT 2014


Summary of changes:
 services/api/app/mailers/admin_notifier.rb | 4 ++--
 services/api/test/unit/user_test.rb        | 8 ++++++++
 2 files changed, 10 insertions(+), 2 deletions(-)

       via  9bb0d7674485783477d428f0deafeb3eb2324305 (commit)
      from  a39032f95b14448950792600cf27aa67a582674c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 9bb0d7674485783477d428f0deafeb3eb2324305
Author: radhika <radhika at curoverse.com>
Date:   Sat Aug 23 15:17:15 2014 -0400

    3153: update tests to look for new user created message also when an inactive user is being created.

diff --git a/services/api/app/mailers/admin_notifier.rb b/services/api/app/mailers/admin_notifier.rb
index d86a281..36798be 100644
--- a/services/api/app/mailers/admin_notifier.rb
+++ b/services/api/app/mailers/admin_notifier.rb
@@ -12,11 +12,11 @@ class AdminNotifier < ActionMailer::Base
 
       add_to_subject = ''
       if Rails.configuration.auto_setup_new_users
-        add_to_subject = @user.is_invited ? 'and setup ' : ', but not setup '
+        add_to_subject = @user.is_invited ? ' and setup' : ', but not setup'
       end
 
       mail(to: @recipients,
-           subject: "#{Rails.configuration.email_subject_prefix}New user created #{add_to_subject}notification"
+           subject: "#{Rails.configuration.email_subject_prefix}New user created#{add_to_subject} notification"
           )
     end
   end
diff --git a/services/api/test/unit/user_test.rb b/services/api/test/unit/user_test.rb
index d93d8ae..dd8afd5 100644
--- a/services/api/test/unit/user_test.rb
+++ b/services/api/test/unit/user_test.rb
@@ -547,6 +547,14 @@ class UserTest < ActiveSupport::TestCase
       else
         assert_nil new_inactive_user_email, 'Did not expect new inactive user email after setup'
       end
+      if not active_recipients.empty? then
+        assert_not_nil new_user_email, 'Expected new user email after setup'
+        assert_equal Rails.configuration.user_notifier_email_from, new_user_email.from[0]
+        assert_equal active_recipients, new_user_email.to[0]
+        assert_equal new_user_email_subject, new_user_email.subject
+      else
+        assert_nil new_user_email, 'Did not expect new user email after setup'
+      end
     end
 
     if active

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list