projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch '14713-fix-master' refs #14713
[arvados.git]
/
services
/
api
/
test
/
functional
/
arvados
/
v1
/
filters_test.rb
diff --git
a/services/api/test/functional/arvados/v1/filters_test.rb
b/services/api/test/functional/arvados/v1/filters_test.rb
index c76b94e4823bc7542a100cdfe6895757744c7347..d49fe7a3e647caec2215c6f911fe5e37b1d6a5ab 100644
(file)
--- a/
services/api/test/functional/arvados/v1/filters_test.rb
+++ b/
services/api/test/functional/arvados/v1/filters_test.rb
@@
-8,7
+8,7
@@
class Arvados::V1::FiltersTest < ActionController::TestCase
test '"not in" filter passes null values' do
@controller = Arvados::V1::GroupsController.new
authorize_with :admin
test '"not in" filter passes null values' do
@controller = Arvados::V1::GroupsController.new
authorize_with :admin
- get :index, {
+ get :index,
params:
{
filters: [ ['group_class', 'not in', ['project']] ],
controller: 'groups',
}
filters: [ ['group_class', 'not in', ['project']] ],
controller: 'groups',
}
@@
-21,7
+21,7
@@
class Arvados::V1::FiltersTest < ActionController::TestCase
test 'error message for non-array element in filters array' do
@controller = Arvados::V1::CollectionsController.new
authorize_with :active
test 'error message for non-array element in filters array' do
@controller = Arvados::V1::CollectionsController.new
authorize_with :active
- get :index, {
+ get :index,
params:
{
filters: [{bogus: 'filter'}],
}
assert_response 422
filters: [{bogus: 'filter'}],
}
assert_response 422
@@
-32,7
+32,7
@@
class Arvados::V1::FiltersTest < ActionController::TestCase
test 'error message for full text search on a specific column' do
@controller = Arvados::V1::CollectionsController.new
authorize_with :active
test 'error message for full text search on a specific column' do
@controller = Arvados::V1::CollectionsController.new
authorize_with :active
- get :index, {
+ get :index,
params:
{
filters: [['uuid', '@@', 'abcdef']],
}
assert_response 422
filters: [['uuid', '@@', 'abcdef']],
}
assert_response 422
@@
-42,7
+42,7
@@
class Arvados::V1::FiltersTest < ActionController::TestCase
test 'difficult characters in full text search' do
@controller = Arvados::V1::CollectionsController.new
authorize_with :active
test 'difficult characters in full text search' do
@controller = Arvados::V1::CollectionsController.new
authorize_with :active
- get :index, {
+ get :index,
params:
{
filters: [['any', '@@', 'a|b"c']],
}
assert_response :success
filters: [['any', '@@', 'a|b"c']],
}
assert_response :success
@@
-52,7
+52,7
@@
class Arvados::V1::FiltersTest < ActionController::TestCase
test 'array operand in full text search' do
@controller = Arvados::V1::CollectionsController.new
authorize_with :active
test 'array operand in full text search' do
@controller = Arvados::V1::CollectionsController.new
authorize_with :active
- get :index, {
+ get :index,
params:
{
filters: [['any', '@@', ['abc', 'def']]],
}
assert_response 422
filters: [['any', '@@', ['abc', 'def']]],
}
assert_response 422
@@
-86,7
+86,7
@@
class Arvados::V1::FiltersTest < ActionController::TestCase
timestamp = mine.modified_at.strftime('%Y-%m-%dT%H:%M:%S.%NZ')
@controller = Arvados::V1::CollectionsController.new
authorize_with :active
timestamp = mine.modified_at.strftime('%Y-%m-%dT%H:%M:%S.%NZ')
@controller = Arvados::V1::CollectionsController.new
authorize_with :active
- get :index, {
+ get :index,
params:
{
filters: [['modified_at', operator, timestamp],
['uuid', '=', mine.uuid]],
}
filters: [['modified_at', operator, timestamp],
['uuid', '=', mine.uuid]],
}
@@
-104,11
+104,11
@@
class Arvados::V1::FiltersTest < ActionController::TestCase
@controller = Arvados::V1::GroupsController.new
authorize_with :admin
@controller = Arvados::V1::GroupsController.new
authorize_with :admin
- get :contents, {
+ get :contents,
params:
{
format: :json,
count: 'none',
limit: 1000,
format: :json,
count: 'none',
limit: 1000,
- filters: [['any', '@@', Rails.configuration.
uuid_prefix
]],
+ filters: [['any', '@@', Rails.configuration.
ClusterID
]],
}
assert_response :success
}
assert_response :success
@@
-131,13
+131,13
@@
class Arvados::V1::FiltersTest < ActionController::TestCase
@controller = Arvados::V1::GroupsController.new
@controller = Arvados::V1::GroupsController.new
- get :contents, {
+ get :contents,
params:
{
format: :json,
count: 'none',
limit: 1000,
offset: '5',
last_object_class: 'PipelineInstance',
format: :json,
count: 'none',
limit: 1000,
offset: '5',
last_object_class: 'PipelineInstance',
- filters: [['any', '@@', Rails.configuration.
uuid_prefix
]],
+ filters: [['any', '@@', Rails.configuration.
ClusterID
]],
}
assert_response :success
}
assert_response :success
@@
-176,7
+176,7
@@
class Arvados::V1::FiltersTest < ActionController::TestCase
test "jsonb filter properties.#{prop} #{op} #{opr})" do
@controller = Arvados::V1::CollectionsController.new
authorize_with :admin
test "jsonb filter properties.#{prop} #{op} #{opr})" do
@controller = Arvados::V1::CollectionsController.new
authorize_with :admin
- get :index, {
+ get :index,
params:
{
filters: SafeJSON.dump([ ["properties.#{prop}", op, opr] ]),
limit: 1000
}
filters: SafeJSON.dump([ ["properties.#{prop}", op, opr] ]),
limit: 1000
}
@@
-196,7
+196,7
@@
class Arvados::V1::FiltersTest < ActionController::TestCase
test "jsonb hash 'exists' and '!=' filter" do
@controller = Arvados::V1::CollectionsController.new
authorize_with :admin
test "jsonb hash 'exists' and '!=' filter" do
@controller = Arvados::V1::CollectionsController.new
authorize_with :admin
- get :index, {
+ get :index,
params:
{
filters: [ ['properties.prop1', 'exists', true], ['properties.prop1', '!=', 'value1'] ]
}
assert_response :success
filters: [ ['properties.prop1', 'exists', true], ['properties.prop1', '!=', 'value1'] ]
}
assert_response :success
@@
-211,7
+211,7
@@
class Arvados::V1::FiltersTest < ActionController::TestCase
test "jsonb array 'exists'" do
@controller = Arvados::V1::CollectionsController.new
authorize_with :admin
test "jsonb array 'exists'" do
@controller = Arvados::V1::CollectionsController.new
authorize_with :admin
- get :index, {
+ get :index,
params:
{
filters: [ ['storage_classes_confirmed.default', 'exists', true] ]
}
assert_response :success
filters: [ ['storage_classes_confirmed.default', 'exists', true] ]
}
assert_response :success
@@
-228,7
+228,7
@@
class Arvados::V1::FiltersTest < ActionController::TestCase
test "jsonb hash alternate form 'exists' and '!=' filter" do
@controller = Arvados::V1::CollectionsController.new
authorize_with :admin
test "jsonb hash alternate form 'exists' and '!=' filter" do
@controller = Arvados::V1::CollectionsController.new
authorize_with :admin
- get :index, {
+ get :index,
params:
{
filters: [ ['properties', 'exists', 'prop1'], ['properties.prop1', '!=', 'value1'] ]
}
assert_response :success
filters: [ ['properties', 'exists', 'prop1'], ['properties.prop1', '!=', 'value1'] ]
}
assert_response :success
@@
-243,7
+243,7
@@
class Arvados::V1::FiltersTest < ActionController::TestCase
test "jsonb array alternate form 'exists' filter" do
@controller = Arvados::V1::CollectionsController.new
authorize_with :admin
test "jsonb array alternate form 'exists' filter" do
@controller = Arvados::V1::CollectionsController.new
authorize_with :admin
- get :index, {
+ get :index,
params:
{
filters: [ ['storage_classes_confirmed', 'exists', 'default'] ]
}
assert_response :success
filters: [ ['storage_classes_confirmed', 'exists', 'default'] ]
}
assert_response :success
@@
-260,7
+260,7
@@
class Arvados::V1::FiltersTest < ActionController::TestCase
test "jsonb 'exists' must be boolean" do
@controller = Arvados::V1::CollectionsController.new
authorize_with :admin
test "jsonb 'exists' must be boolean" do
@controller = Arvados::V1::CollectionsController.new
authorize_with :admin
- get :index, {
+ get :index,
params:
{
filters: [ ['properties.prop1', 'exists', nil] ]
}
assert_response 422
filters: [ ['properties.prop1', 'exists', nil] ]
}
assert_response 422
@@
-271,7
+271,7
@@
class Arvados::V1::FiltersTest < ActionController::TestCase
test "jsonb checks column exists" do
@controller = Arvados::V1::CollectionsController.new
authorize_with :admin
test "jsonb checks column exists" do
@controller = Arvados::V1::CollectionsController.new
authorize_with :admin
- get :index, {
+ get :index,
params:
{
filters: [ ['puppies.prop1', '=', 'value1'] ]
}
assert_response 422
filters: [ ['puppies.prop1', '=', 'value1'] ]
}
assert_response 422
@@
-282,7
+282,7
@@
class Arvados::V1::FiltersTest < ActionController::TestCase
test "jsonb checks column is valid" do
@controller = Arvados::V1::CollectionsController.new
authorize_with :admin
test "jsonb checks column is valid" do
@controller = Arvados::V1::CollectionsController.new
authorize_with :admin
- get :index, {
+ get :index,
params:
{
filters: [ ['name.prop1', '=', 'value1'] ]
}
assert_response 422
filters: [ ['name.prop1', '=', 'value1'] ]
}
assert_response 422
@@
-293,7
+293,7
@@
class Arvados::V1::FiltersTest < ActionController::TestCase
test "jsonb invalid operator" do
@controller = Arvados::V1::CollectionsController.new
authorize_with :admin
test "jsonb invalid operator" do
@controller = Arvados::V1::CollectionsController.new
authorize_with :admin
- get :index, {
+ get :index,
params:
{
filters: [ ['properties.prop1', '###', 'value1'] ]
}
assert_response 422
filters: [ ['properties.prop1', '###', 'value1'] ]
}
assert_response 422
@@
-304,7
+304,7
@@
class Arvados::V1::FiltersTest < ActionController::TestCase
test "replication_desired = 2" do
@controller = Arvados::V1::CollectionsController.new
authorize_with :admin
test "replication_desired = 2" do
@controller = Arvados::V1::CollectionsController.new
authorize_with :admin
- get :index, {
+ get :index,
params:
{
filters: SafeJSON.dump([ ['replication_desired', '=', 2] ])
}
assert_response :success
filters: SafeJSON.dump([ ['replication_desired', '=', 2] ])
}
assert_response :success
@@
-312,5
+312,4
@@
class Arvados::V1::FiltersTest < ActionController::TestCase
assert_includes(found, collections(:replication_desired_2_unconfirmed).uuid)
assert_includes(found, collections(:replication_desired_2_confirmed_2).uuid)
end
assert_includes(found, collections(:replication_desired_2_unconfirmed).uuid)
assert_includes(found, collections(:replication_desired_2_confirmed_2).uuid)
end
-
end
end