1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: AGPL-3.0
5 require 'integration_helper'
6 require 'helpers/share_object_helper'
8 class RepositoriesTest < ActionDispatch::IntegrationTest
9 include ShareObjectHelper
19 test "#{user} can manage sharing for another user" do
20 add_user = api_fixture('users')['future_project_user']
21 new_name = ["first_name", "last_name"].map { |k| add_user[k] }.join(" ")
22 show_object_using(user, 'repositories', 'foo',
23 api_fixture('repositories')['foo']['name'])
25 add_share_and_check("users", new_name, add_user)
26 modify_share_and_check(new_name)
34 test "#{user} can manage sharing for another group" do
35 new_name = api_fixture('groups')['future_project_viewing_group']['name']
36 show_object_using(user, 'repositories', 'foo',
37 api_fixture('repositories')['foo']['name'])
39 add_share_and_check("groups", new_name)
40 modify_share_and_check(new_name)
44 test "spectator does not see repository sharing tab" do
45 show_object_using('spectator', 'repositories', 'arvados',
46 api_fixture('repositories')['arvados']['name'])
47 assert(page.has_no_link?("Sharing"),
48 "read-only repository user sees sharing tab")