Fix invalid records in API collections test fixture and improve error message
authorPeter Amstutz <peter.amstutz@curoverse.com>
Wed, 29 Mar 2017 15:43:20 +0000 (11:43 -0400)
committerPeter Amstutz <peter.amstutz@curoverse.com>
Wed, 29 Mar 2017 15:43:20 +0000 (11:43 -0400)
to include both values.  Incidentally revealed by adding PDH index to
collections table.  refs #11361

services/api/app/models/collection.rb
services/api/test/fixtures/collections.yml

index 6d1a0d5b55f595fcaa30baf9937432eb88bc923c..b45c178fb498af1eb588c55982ad38f2bfdeb70e 100644 (file)
@@ -163,7 +163,7 @@ class Collection < ArvadosModel
       false
     elsif portable_data_hash[0..31] != computed_pdh[0..31]
       errors.add(:portable_data_hash,
-                 "does not match computed hash #{computed_pdh}")
+                 "'#{portable_data_hash}' does not match computed hash '#{computed_pdh}'")
       false
     else
       # Ignore the client-provided size part: always store
index 5f7bad8abe2ed94d14986045290076d56e671e10..2f4d5b08a836dbd0cf3fc5c39bcdf9586521ca50 100644 (file)
@@ -562,7 +562,7 @@ collection_with_one_property:
 # The following four collections are used to test combining collections with repeated filenames
 collection_with_repeated_filenames_and_contents_in_two_dirs_1:
   uuid: zzzzz-4zz18-duplicatenames1
-  portable_data_hash: fa7aeb5140e2848d39b416daeef4ffc5+45
+  portable_data_hash: f3a67fad3a19c31c658982fb8158fa58+144
   owner_uuid: zzzzz-tpzed-xurymjxw79nv3jz
   created_at: 2014-02-03T17:22:54Z
   modified_by_client_uuid: zzzzz-ozdt8-brczlopd8u8d0jr
@@ -574,7 +574,7 @@ collection_with_repeated_filenames_and_contents_in_two_dirs_1:
 
 collection_with_repeated_filenames_and_contents_in_two_dirs_2:
   uuid: zzzzz-4zz18-duplicatenames2
-  portable_data_hash: fa7aeb5140e2848d39b416daeef4ffc5+45
+  portable_data_hash: f3a67fad3a19c31c658982fb8158fa58+144
   owner_uuid: zzzzz-tpzed-xurymjxw79nv3jz
   created_at: 2014-02-03T17:22:54Z
   modified_by_client_uuid: zzzzz-ozdt8-brczlopd8u8d0jr