3 class Arvados::V1::LogsControllerTest < ActionController::TestCase
6 test "non-admins can read their own logs" do
8 post :create, log: {summary: "test log"}
9 assert_response :success
10 uuid = JSON.parse(@response.body)['uuid']
13 assert_response(:success, "failed to load created log")
14 assert_equal("test log", assigns(:object).summary,
15 "loaded wrong log after creation")
18 test "test can still use where object_kind" do
21 where: { object_kind: 'arvados#user' }
23 assert_response :success
24 found = assigns(:objects)
25 assert_not_equal 0, found.count
26 assert_equal found.count, (found.select { |f| f.object_uuid.match /[a-z0-9]{5}-tpzed-[a-z0-9]{15}/}).count
27 l = JSON.parse(@response.body)
28 assert_equal 'arvados#user', l['items'][0]['object_kind']
31 test "test can still use filter object_kind" do
34 filters: [ ['object_kind', '=', 'arvados#user'] ]
36 assert_response :success
37 found = assigns(:objects)
38 assert_not_equal 0, found.count
39 assert_equal found.count, (found.select { |f| f.object_uuid.match /[a-z0-9]{5}-tpzed-[a-z0-9]{15}/}).count