3 class Arvados::V1::LogsControllerTest < ActionController::TestCase
6 test "non-admins can create their own logs" do
8 post :create, log: {summary: 'test log'}
9 assert_response :success
10 resp = assigns(:object)
11 assert_not_nil resp.uuid
12 assert_equal('test log', resp.summary, "loaded wrong log after creation")
15 test "non-admins can read their own logs" do
16 authorize_with :active
17 my_log = logs(:log_owned_by_active)
18 get :show, {id: my_log[:uuid]}
19 assert_response(:success, "failed to get log")
20 resp = assigns(:object)
21 assert_equal(my_log[:summary], resp.summary, "got wrong log")
24 test "test can still use where object_kind" do
27 where: { object_kind: 'arvados#user' }
29 assert_response :success
30 found = assigns(:objects)
31 assert_not_equal 0, found.count
32 assert_equal found.count, (found.select { |f| f.object_uuid.match User.uuid_regex }).count
33 l = JSON.parse(@response.body)
34 assert_equal 'arvados#user', l['items'][0]['object_kind']
37 test "test can still use filter object_kind" do
40 filters: [ ['object_kind', '=', 'arvados#user'] ]
42 assert_response :success
43 found = assigns(:objects)
44 assert_not_equal 0, found.count
45 assert_equal found.count, (found.select { |f| f.object_uuid.match User.uuid_regex }).count