Merge branch 'master' into 2244-sdk-docs
[arvados.git] / services / api / test / integration / collections_api_test.rb
index 076b2342a2a64798efb8e478c444532c1c592d45..5a3250ea0d2dfc51af4d5e4ee4949057448f8d43 100644 (file)
@@ -3,16 +3,24 @@ require 'test_helper'
 class CollectionsApiTest < ActionDispatch::IntegrationTest
   fixtures :all
 
-  def jresponse
-    @jresponse ||= ActiveSupport::JSON.decode @response.body
-  end
-
   test "should get index" do
     get "/arvados/v1/collections", {:format => :json}, {'HTTP_AUTHORIZATION' => "OAuth2 #{api_client_authorizations(:active).api_token}"}
     assert_response :success
     assert_equal "arvados#collectionList", jresponse['kind']
   end
 
+  test "get index with filters= (empty string)" do
+    get "/arvados/v1/collections", {:format => :json, :filters => ''}, {'HTTP_AUTHORIZATION' => "OAuth2 #{api_client_authorizations(:active).api_token}"}
+    assert_response :success
+    assert_equal "arvados#collectionList", jresponse['kind']
+  end
+
+  test "get index with where= (empty string)" do
+    get "/arvados/v1/collections", {:format => :json, :where => ''}, {'HTTP_AUTHORIZATION' => "OAuth2 #{api_client_authorizations(:active).api_token}"}
+    assert_response :success
+    assert_equal "arvados#collectionList", jresponse['kind']
+  end
+
   test "controller 404 response is json" do
     get "/arvados/v1/thingsthatdonotexist", {:format => :xml}, {'HTTP_AUTHORIZATION' => "OAuth2 #{api_client_authorizations(:active).api_token}"}
     assert_response 404