14484: Adds test for updating a collection with file stats and manifest changes
authorEric Biagiotti <ebiagiotti@veritasgenetics.com>
Wed, 3 Apr 2019 20:20:26 +0000 (16:20 -0400)
committerEric Biagiotti <ebiagiotti@veritasgenetics.com>
Wed, 3 Apr 2019 20:20:26 +0000 (16:20 -0400)
Arvados-DCO-1.1-Signed-off-by: Eric Biagiotti <ebiagiotti@veritasgenetics.com>

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

index 27d4fee795134f4ea4cfa10e2270e0e4fb5a0eb6..ff581e44291d89a109f0228a2e4bf23399345c8d 100644 (file)
@@ -1002,6 +1002,24 @@ EOS
     end
   end
 
+  [
+    ['file_count', 1],
+    ['file_size_total', 34]
+  ].each do |attribute, val|
+    test "update collection with #{attribute} and manifest and expect manifest values" do
+      authorize_with :active
+      post :update, {
+        id: collections(:collection_owned_by_active_with_file_stats).uuid,
+        collection: {
+          manifest_text: ". d41d8cd98f00b204e9800998ecf8427e 0:34:foo.txt\n",
+          "#{attribute}": 10
+        }
+      }
+      assert_response 200
+      assert_equal val, json_response[attribute]
+    end
+  end
+
   [
     ". 0:0:foo.txt",
     ". d41d8cd98f00b204e9800998ecf8427e foo.txt",