X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/559acee1dca5524f9650e360d5f16fc1582a77f0..1996b03c10e45d4c1959b40333c57261a040bffb:/services/api/test/unit/collection_test.rb diff --git a/services/api/test/unit/collection_test.rb b/services/api/test/unit/collection_test.rb index d6b50da140..c81d543ebb 100644 --- a/services/api/test/unit/collection_test.rb +++ b/services/api/test/unit/collection_test.rb @@ -40,7 +40,6 @@ class CollectionTest < ActiveSupport::TestCase end [ - nil, ". 0:0:foo.txt", ". d41d8cd98f00b204e9800998ecf8427e foo.txt", "d41d8cd98f00b204e9800998ecf8427e 0:0:foo.txt", @@ -56,6 +55,18 @@ class CollectionTest < ActiveSupport::TestCase [ nil, + "", + ". d41d8cd98f00b204e9800998ecf8427e 0:0:foo.txt\n", + ].each do |manifest_text| + test "create collection with valid manifest text #{manifest_text.inspect} and expect success" do + act_as_system_user do + c = Collection.create(manifest_text: manifest_text) + assert c.valid? + end + end + end + + [ ". 0:0:foo.txt", ". d41d8cd98f00b204e9800998ecf8427e foo.txt", "d41d8cd98f00b204e9800998ecf8427e 0:0:foo.txt", @@ -72,6 +83,22 @@ class CollectionTest < ActiveSupport::TestCase end end + [ + nil, + "", + ". d41d8cd98f00b204e9800998ecf8427e 0:0:foo.txt\n", + ].each do |manifest_text| + test "update collection with valid manifest text #{manifest_text.inspect} and expect success" do + act_as_system_user do + c = create_collection 'foo', Encoding::US_ASCII + assert c.valid? + + c.update_attribute 'manifest_text', manifest_text + assert c.valid? + end + end + end + test 'create and update collection and verify file_names' do act_as_system_user do c = create_collection 'foo', Encoding::US_ASCII