3 class CollectionsApiTest < ActionDispatch::IntegrationTest
6 test "should get index" do
7 get "/arvados/v1/collections", {:format => :json}, {'HTTP_AUTHORIZATION' => "OAuth2 #{api_client_authorizations(:active).api_token}"}
8 assert_response :success
9 assert_equal "arvados#collectionList", jresponse['kind']
12 test "get index with filters= (empty string)" do
13 get "/arvados/v1/collections", {:format => :json, :filters => ''}, {'HTTP_AUTHORIZATION' => "OAuth2 #{api_client_authorizations(:active).api_token}"}
14 assert_response :success
15 assert_equal "arvados#collectionList", jresponse['kind']
18 test "get index with where= (empty string)" do
19 get "/arvados/v1/collections", {:format => :json, :where => ''}, {'HTTP_AUTHORIZATION' => "OAuth2 #{api_client_authorizations(:active).api_token}"}
20 assert_response :success
21 assert_equal "arvados#collectionList", jresponse['kind']
24 test "controller 404 response is json" do
25 get "/arvados/v1/thingsthatdonotexist", {:format => :xml}, {'HTTP_AUTHORIZATION' => "OAuth2 #{api_client_authorizations(:active).api_token}"}
27 assert_equal 1, jresponse['errors'].length
28 assert_equal true, jresponse['errors'][0].is_a?(String)
31 test "object 404 response is json" do
32 get "/arvados/v1/groups/zzzzz-j7d0g-o5ba971173cup4f", {}, {'HTTP_AUTHORIZATION' => "OAuth2 #{api_client_authorizations(:active).api_token}"}
34 assert_equal 1, jresponse['errors'].length
35 assert_equal true, jresponse['errors'][0].is_a?(String)