Merge branch 'master' into 3618-column-ordering
[arvados.git] / services / api / test / functional / arvados / v1 / users_controller_test.rb
index 9c4d18b24152012f8161ec8ab0c0d1521c611413..2d26370b749f5b07dc866855563c62cd31f9c03a 100644 (file)
@@ -779,6 +779,16 @@ class Arvados::V1::UsersControllerTest < ActionController::TestCase
     assert_equal false, found_email, 'Expected no email after updating profile'
   end
 
+  test "user API response includes writable_by" do
+    authorize_with :active
+    get :current
+    assert_response :success
+    assert_includes(json_response["writable_by"], users(:active).uuid,
+                    "user's writable_by should include self")
+    assert_includes(json_response["writable_by"], users(:active).owner_uuid,
+                    "user's writable_by should include its owner_uuid")
+  end
+
 
   NON_ADMIN_USER_DATA = ["uuid", "kind", "is_active", "email", "first_name",
                          "last_name"].sort