diff --git a/lib/verifier/post_zephir.rb b/lib/verifier/post_zephir.rb index b85ef77..c165403 100644 --- a/lib/verifier/post_zephir.rb +++ b/lib/verifier/post_zephir.rb @@ -153,7 +153,7 @@ def verify_rights(date: current_date) # * exist & be be readable (both covered by verify_rights) # * either be empty, or all its lines must match regex. def verify_rights_file_format(path:) - line_regex = /^ [a-z0-9]+ \. [a-z0-9:\/\$\.]+ # col 1, namespace.objid + line_regex = /^ [a-z0-9]+ \. \S+ # col 1, namespace.objid \t (ic|pd|pdus|und) # col 2, one of these \t bib # col 3, exactly this \t bibrights # col 4, exactly this diff --git a/spec/unit/verifier/post_zephir_spec.rb b/spec/unit/verifier/post_zephir_spec.rb index d7e4ed8..c114b91 100644 --- a/spec/unit/verifier/post_zephir_spec.rb +++ b/spec/unit/verifier/post_zephir_spec.rb @@ -351,7 +351,7 @@ def expect_deletefile_ok(contents) volids_not_ok = ["", "x", "x.", ".x", "X.X"] volids_not_ok.each do |bad_volume_id| - it "rejects a file with malformed volume id" do + it "rejects a file with malformed volume id #{bad_volume_id}" do rights_cols[0] = bad_volume_id expect_not_ok( @@ -362,6 +362,17 @@ def expect_deletefile_ok(contents) end end + ["uiuc.0001_001_001", "uc1.$b123456", "miun.aaa0001.001.001", "ucbk.ark:/28722/h2b854467"].each do |ok_volume_id| + it "accepts a file with non-alphanumeric htid #{ok_volume_id}" do + rights_cols[0] = ok_volume_id + + expect_ok( + :verify_rights_file_format, + rights_cols.join("\t") + ) + end + end + it "rejects a file with no rights" do rights_cols[1] = "" expect_not_ok(:verify_rights_file_format, rights_cols.join("\t"), errmsg: /invalid column rights/)