[ARVADOS] updated: 49aaa9f26dfaf50056abd7527976b681be26208b

git at public.curoverse.com git at public.curoverse.com
Tue Apr 22 17:02:16 EDT 2014


Summary of changes:
 services/api/app/models/user.rb                    |    2 +-
 .../views/user_notifier/account_is_setup.text.erb  |   13 ++++++++++---
 services/api/test/unit/user_test.rb                |   11 +++++++++++
 3 files changed, 22 insertions(+), 4 deletions(-)

       via  49aaa9f26dfaf50056abd7527976b681be26208b (commit)
       via  f03e21f7d50e34e7f7f7e7f570e8604fbd4d27da (commit)
      from  35295980b918232db8a8f3321e3bf02729e26c9f (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 49aaa9f26dfaf50056abd7527976b681be26208b
Author: Ward Vandewege <ward at curoverse.com>
Date:   Tue Apr 22 17:00:16 2014 -0400

    Improve wording of the welcome e-mail a bit.

diff --git a/services/api/app/views/user_notifier/account_is_setup.text.erb b/services/api/app/views/user_notifier/account_is_setup.text.erb
index 0f584c7..ba360c0 100644
--- a/services/api/app/views/user_notifier/account_is_setup.text.erb
+++ b/services/api/app/views/user_notifier/account_is_setup.text.erb
@@ -1,6 +1,13 @@
+<% if not @user.full_name.empty? -%>
 <%= @user.full_name %>,
+<% else -%>
+Hi there,
+<% end -%>
 
-Your Arvados account has been set up. You can log in here using your
-Google account (<%= @user.email %>):
+Your Arvados account has been set up. You can log in with your Google account
+associated with the e-mail address <%= @user.email %> at:
 
-<%= Rails.configuration.workbench_address %>
+  <%= Rails.configuration.workbench_address %>
+
+Thanks,
+The Arvados team.

commit f03e21f7d50e34e7f7f7e7f570e8604fbd4d27da
Author: Ward Vandewege <ward at curoverse.com>
Date:   Tue Apr 22 16:55:34 2014 -0400

    User.full_name should not contain just a space when first_name and
    last_name are not set.
    
    Add a test for that, too.

diff --git a/services/api/app/models/user.rb b/services/api/app/models/user.rb
index 513e0ae..81cae98 100644
--- a/services/api/app/models/user.rb
+++ b/services/api/app/models/user.rb
@@ -27,7 +27,7 @@ class User < ArvadosModel
   ALL_PERMISSIONS = {read: true, write: true, manage: true}
 
   def full_name
-    "#{first_name} #{last_name}"
+    "#{first_name} #{last_name}".strip
   end
 
   def is_invited
diff --git a/services/api/test/unit/user_test.rb b/services/api/test/unit/user_test.rb
index 67d0bad..fd56a74 100644
--- a/services/api/test/unit/user_test.rb
+++ b/services/api/test/unit/user_test.rb
@@ -87,6 +87,17 @@ class UserTest < ActiveSupport::TestCase
     assert_equal found_user.identity_url, user.identity_url
   end
 
+  test "full name should not contain spurious whitespace" do
+    user = User.create ({uuid: 'zzzzz-tpzed-abcdefghijklmno', email: 'foo at example.com' })
+
+    assert_equal '', user.full_name
+
+    user.first_name = 'John'
+    user.last_name = 'Smith'
+
+    assert_equal user.first_name + ' ' + user.last_name, user.full_name
+  end
+
   test "create new user" do
     Thread.current[:user] = @admin_user   # set admin user as the current user
 

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list