1 require 'integration_helper'
2 require 'helpers/share_object_helper'
4 class RepositoriesTest < ActionDispatch::IntegrationTest
5 include ShareObjectHelper
15 test "#{user} can manage sharing for another user" do
16 add_user = api_fixture('users')['future_project_user']
17 new_name = ["first_name", "last_name"].map { |k| add_user[k] }.join(" ")
18 show_object_using(user, 'repositories', 'foo',
19 api_fixture('repositories')['foo']['name'])
21 add_share_and_check("users", new_name, add_user)
22 modify_share_and_check(new_name)
30 test "#{user} can manage sharing for another group" do
31 new_name = api_fixture('groups')['future_project_viewing_group']['name']
32 show_object_using(user, 'repositories', 'foo',
33 api_fixture('repositories')['foo']['name'])
35 add_share_and_check("groups", new_name)
36 modify_share_and_check(new_name)
40 test "spectator does not see repository sharing tab" do
41 show_object_using('spectator', 'repositories', 'arvados',
42 api_fixture('repositories')['arvados']['name'])
43 assert(page.has_no_link?("Sharing"),
44 "read-only repository user sees sharing tab")
51 test "#{user_key} user is presented with attributes tab" do
52 user = api_fixture('users')[user_key]
53 show_object_using(user_key, 'repositories', 'foo',
54 api_fixture('repositories')['foo']['name'])
56 assert_selector 'li', text: 'Attributes'
58 assert_no_selector 'li', text: 'Attributes'
60 assert_selector 'li', text: 'Advanced'