Merge branch '2620-keep-serialize-io' (closes #2620)
[arvados.git] / services / api / test / unit / user_test.rb
index 67d0badf2401e2ed151544a1206d578968e41261..2d2db160cd3a0e971dd7ae56073b1de85216cfd0 100644 (file)
@@ -87,6 +87,19 @@ class UserTest < ActiveSupport::TestCase
     assert_equal found_user.identity_url, user.identity_url
   end
 
+  test "full name should not contain spurious whitespace" do
+    Thread.current[:user] = @admin_user   # set admin user as the current user
+
+    user = User.create ({uuid: 'zzzzz-tpzed-abcdefghijklmno', email: 'foo@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