3 class GroupsTest < ActionDispatch::IntegrationTest
5 test "get all pages of group-owned objects" do
14 get "/arvados/v1/groups/contents", {
15 id: groups(:aproject).uuid,
21 assert_response :success
22 assert_operator(0, :<, json_response['items'].count,
23 "items_available=#{items_available} but received 0 "\
24 "items with offset=#{offset}")
25 items_available ||= json_response['items_available']
26 assert_equal(items_available, json_response['items_available'],
27 "items_available changed between page #{offset/limit} "\
28 "and page #{1+offset/limit}")
29 json_response['items'].each do |item|
31 assert_equal(nil, uuid_received[uuid],
32 "Received '#{uuid}' again on page #{1+offset/limit}")
33 uuid_received[uuid] = true
34 owner_received[item['owner_uuid']] = true
36 assert_equal groups(:aproject).uuid, item['owner_uuid']
38 break if offset >= items_available
43 ['Collection_', true], # collections and pipelines templates
44 ['hash', true], # pipeline templates
45 ['fa7aeb5140e2848d39b', false], # script_parameter of pipeline instances
46 ['fa7aeb5140e2848d39b:*', true], # script_parameter of pipeline instances
47 ['project pipeline', true], # finds "Completed pipeline in A Project"
48 ['project pipeli:*', true], # finds "Completed pipeline in A Project"
49 ['proje pipeli:*', false], # first word is incomplete, so no prefix match
50 ['no-such-thing', false], # script_parameter of pipeline instances
51 ].each do |search_filter, expect_results|
52 test "full text search of group-owned objects for #{search_filter}" do
53 get "/arvados/v1/groups/contents", {
54 id: groups(:aproject).uuid,
56 :filters => [['any', '@@', search_filter]].to_json
58 assert_response :success
60 refute_empty json_response['items']
61 json_response['items'].each do |item|
63 assert_equal groups(:aproject).uuid, item['owner_uuid']
66 assert_empty json_response['items']
71 test "full text search is not supported for individual columns" do
72 get "/arvados/v1/groups/contents", {
73 :filters => [['name', '@@', 'Private']].to_json