+ signing_opts = {
+ key: Rails.configuration.blob_signing_key,
+ api_token: api_token(:active),
+ }
+ signed_locator = Blob.sign_locator('bad42fa702ae3ea7d999fef11b46f450+44', signing_opts)
+
+ # create collection
+ post "/arvados/v1/collections", {
+ format: :json,
+ collection: "{\"manifest_text\":\". #{signed_locator} 0:44:my_test_file.txt\\n\"}"
+ }, auth(:active)
+ assert_response :success
+ assert_equal true, json_response['manifest_text'].include?('my_test_file.txt')
+ assert_equal '0f99f4087beb13dec46d36db9fa6cebf+60', json_response['portable_data_hash']
+ assert_nil json_response['description']
+ assert_nil json_response['file_names']
+
+ created = json_response
+
+ # search using the filename
+ search_using_file_name 'my_test_file.txt', 1, nil, '0f99f4087beb13dec46d36db9fa6cebf+60'
+
+ # update collection's desc
+ put "/arvados/v1/collections/#{created['uuid']}", {
+ format: :json,
+ collection: { description: "my test collection description" }
+ }, auth(:active)
+ assert_response :success
+ assert_equal created['uuid'], json_response['uuid']
+ assert_equal true, json_response['manifest_text'].include?('my_test_file.txt')
+ assert_equal 'my test collection description', json_response['description']
+ assert_equal '0f99f4087beb13dec46d36db9fa6cebf+60', json_response['portable_data_hash']
+ assert_nil json_response['file_names']
+
+ # update the collection's manifest text
+ put "/arvados/v1/collections/#{json_response['uuid']}", {
+ format: :json,
+ collection: "{\"manifest_text\":\". #{signed_locator} 0:44:my_updated_test_file.txt\\n\"}"
+ }, auth(:active)
+ assert_response :success
+ assert_equal created['uuid'], json_response['uuid']
+ assert_equal true, json_response['manifest_text'].include?('my_updated_test_file.txt')
+ assert_equal false, json_response['manifest_text'].include?('my_test_file.txt')
+ assert_equal 'my test collection description', json_response['description']
+ assert_equal '17d7d7e6f09ae17e3b580143586a1a3f+68', json_response['portable_data_hash']
+ assert_nil json_response['file_names']
+
+ search_using_file_name 'my_updated_test_file.txt', 1, 'my test collection description', '17d7d7e6f09ae17e3b580143586a1a3f+68'
+ search_using_file_name 'my_test_file.txt', 0, nil, nil
+ search_using_file_name 'there_is_no_such_file.txt', 0, nil, nil
+ end