15227: Adds test exposing bug.
authorLucas Di Pentima <ldipentima@veritasgenetics.com>
Wed, 15 May 2019 18:50:24 +0000 (15:50 -0300)
committerLucas Di Pentima <ldipentima@veritasgenetics.com>
Wed, 15 May 2019 18:50:24 +0000 (15:50 -0300)
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima@veritasgenetics.com>

services/api/test/functional/arvados/v1/collections_controller_test.rb

index cc545b2fd1a92fbb892f3e8a78dc759996cb8b55..244fa0ce585dad477abc81c2f5ac271a4b033f04 100644 (file)
@@ -939,6 +939,28 @@ EOS
     assert_equal 'value_1', json_response['properties']['property_1']
   end
 
+  [
+    false,
+    [],
+    42,
+    'some string',
+    '["json", "encoded", "list"]',
+  ].each do |p|
+    test "create collection with non-valid properties param #{p.inspect}" do
+      authorize_with :active
+      post :create, params: {
+        collection: {
+          name: "test collection with non-valid properties param '#{p.inspect}'",
+          manifest_text: '',
+          properties: p
+        }
+      }
+      assert_response 422
+      response_errors = json_response['errors']
+      assert_not_nil response_errors, 'Expected error in response'
+    end
+  end
+
   [
     [". d41d8cd98f00b204e9800998ecf8427e 0:34:foo.txt\n", 1, 34],
     [". d41d8cd98f00b204e9800998ecf8427e 0:34:foo.txt 0:30:foo.txt 0:30:foo1.txt 0:30:foo2.txt 0:30:foo3.txt 0:30:foo4.txt\n", 5, 184],