X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/e3c48fef662408636cb49fe1bb0a3c1040269e7c..e08c67024acccb83a30d2010c34862973b883585:/services/api/test/functional/arvados/v1/logs_controller_test.rb diff --git a/services/api/test/functional/arvados/v1/logs_controller_test.rb b/services/api/test/functional/arvados/v1/logs_controller_test.rb index 9c410996b8..a224e2573f 100644 --- a/services/api/test/functional/arvados/v1/logs_controller_test.rb +++ b/services/api/test/functional/arvados/v1/logs_controller_test.rb @@ -1,6 +1,8 @@ require 'test_helper' class Arvados::V1::LogsControllerTest < ActionController::TestCase + fixtures :logs + test "non-admins can read their own logs" do authorize_with :active post :create, log: {summary: "test log"} @@ -12,4 +14,29 @@ class Arvados::V1::LogsControllerTest < ActionController::TestCase assert_equal("test log", assigns(:object).summary, "loaded wrong log after creation") end + + test "test can still use where object_kind" do + authorize_with :admin + get :index, { + where: { object_kind: 'arvados#user' } + } + assert_response :success + found = assigns(:objects) + assert_not_equal 0, found.count + assert_equal found.count, (found.select { |f| f.object_uuid.match /[a-z0-9]{5}-tpzed-[a-z0-9]{15}/}).count + l = JSON.parse(@response.body) + assert_equal 'arvados#user', l['items'][0]['object_kind'] + end + + test "test can still use filter object_kind" do + authorize_with :admin + get :index, { + filters: [ ['object_kind', '=', 'arvados#user'] ] + } + assert_response :success + found = assigns(:objects) + assert_not_equal 0, found.count + assert_equal found.count, (found.select { |f| f.object_uuid.match /[a-z0-9]{5}-tpzed-[a-z0-9]{15}/}).count + end + end