3 class CollectionsApiTest < ActionDispatch::IntegrationTest
6 test "should get index" do
7 get "/arvados/v1/collections", {:format => :json}, auth(:active)
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 => ''}, auth(:active)
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 => ''}, auth(:active)
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}, auth(:active)
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", {}, auth(:active)
34 assert_equal 1, jresponse['errors'].length
35 assert_equal true, jresponse['errors'][0].is_a?(String)
38 test "store collection as json" do
39 post "/arvados/v1/collections", {
41 collection: "{\"manifest_text\":\". bad42fa702ae3ea7d888fef11b46f450+44 0:44:md5sum.txt\\n\",\"uuid\":\"ad02e37b6a7f45bbe2ead3c29a109b8a+54\"}"
44 assert_equal 'ad02e37b6a7f45bbe2ead3c29a109b8a+54', jresponse['uuid']