X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/ca6c0353c236d5fc0f829880e845cbd8489ea9ad..9551b59d3aab67f77240b90bbb550faec6b2a7d9:/services/api/test/functional/arvados/v1/users_controller_test.rb diff --git a/services/api/test/functional/arvados/v1/users_controller_test.rb b/services/api/test/functional/arvados/v1/users_controller_test.rb index c807a7d6cb..6a7b00a005 100644 --- a/services/api/test/functional/arvados/v1/users_controller_test.rb +++ b/services/api/test/functional/arvados/v1/users_controller_test.rb @@ -13,6 +13,7 @@ class Arvados::V1::UsersControllerTest < ActionController::TestCase @initial_link_count = Link.count @vm_uuid = virtual_machines(:testvm).uuid ActionMailer::Base.deliveries = [] + Rails.configuration.Users.ActivatedUsersAreVisibleToOthers = false end test "activate a user after signing UA" do @@ -673,6 +674,12 @@ The Arvados team. get(:index) check_non_admin_index check_readable_users_index [:spectator], [:inactive, :active] + json_response["items"].each do |u| + if u["uuid"] == users(:spectator).uuid + assert_equal true, u["can_write"] + assert_equal true, u["can_manage"] + end + end end test "non-admin user gets only safe attributes from users#show" do @@ -1078,7 +1085,7 @@ The Arvados team. end NON_ADMIN_USER_DATA = ["uuid", "kind", "is_active", "email", "first_name", - "last_name", "username"].sort + "last_name", "username", "can_write", "can_manage"].sort def check_non_admin_index assert_response :success