3354: Merge branch 'master' into 3354-render-textile
[arvados.git] / apps / workbench / test / unit / group_test.rb
1 require 'test_helper'
2
3 class GroupTest < ActiveSupport::TestCase
4   test "get contents with names" do
5     use_token :active
6     oi = Group.
7       find(api_fixture('groups')['asubproject']['uuid']).
8       contents()
9     assert_operator(0, :<, oi.count,
10                     "Expected to find some items belonging to :active user")
11     assert_operator(0, :<, oi.items_available,
12                     "Expected contents response to have items_available > 0")
13     oi_uuids = oi.collect { |i| i['uuid'] }
14
15     expect_uuid = api_fixture('specimens')['in_asubproject']['uuid']
16     assert_includes(oi_uuids, expect_uuid,
17                     "Expected '#{expect_uuid}' in asubproject's contents")
18   end
19
20   test "can select specific group columns" do
21     use_token :admin
22     Group.select(["uuid", "name"]).limit(5).each do |user|
23       assert_not_nil user.uuid
24       assert_not_nil user.name
25       assert_nil user.owner_uuid
26     end
27   end
28 end