3 class ResourceListTest < ActiveSupport::TestCase
5 test 'links_for on a resource list that does not return links' do
8 assert_equal [], results.links_for(api_fixture('users')['active']['uuid'])
11 test 'links_for returns all link classes (simulated results)' do
12 project_uuid = api_fixture('groups')['aproject']['uuid']
13 specimen_uuid = api_fixture('specimens')['in_aproject']['uuid']
15 kind: 'arvados#specimenList',
16 links: [{kind: 'arvados#link',
17 uuid: 'zzzzz-o0j2j-asdfasdfasdfas1',
18 tail_uuid: project_uuid,
19 head_uuid: specimen_uuid,
22 {kind: 'arvados#link',
23 uuid: 'zzzzz-o0j2j-asdfasdfasdfas2',
24 tail_uuid: project_uuid,
25 head_uuid: specimen_uuid,
28 items: [{kind: 'arvados#specimen',
31 arl = ArvadosResourceList.new
32 arl.results = ArvadosApiClient.new.unpack_api_response(api_response)
33 assert_equal(['foo', nil],
35 links_for(specimen_uuid).
36 collect { |x| x.link_class }),
37 "Expected links_for to return all link_classes")