Skip to content

Commit c941e2f

Browse files
authored
Storage Custom Metadata Deletion (#9858)
1 parent c2bc549 commit c941e2f

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

FirebaseStorageInternal/Tests/Integration/FIRStorageIntegrationTests.m

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -631,26 +631,28 @@ - (void)testUpdateMetadata {
631631
metadata.contentEncoding = @"gzip";
632632
metadata.contentLanguage = @"de";
633633
metadata.contentType = @"content-type-a";
634-
metadata.customMetadata = @{@"a" : @"b"};
634+
metadata.customMetadata = @{@"a" : @"b", @"y" : @"z"};
635635

636636
[ref updateMetadata:metadata
637637
completion:^(FIRStorageMetadata *updatedMetadata, NSError *error) {
638638
XCTAssertNil(error);
639639
[self assertMetadata:updatedMetadata
640640
contentType:@"content-type-a"
641-
customMetadata:@{@"a" : @"b"}];
641+
customMetadata:@{@"a" : @"b", @"y" : @"z"}];
642642

643643
// Update a subset of the metadata using the existing object.
644644
FIRStorageMetadata *metadata = updatedMetadata;
645645
metadata.contentType = @"content-type-b";
646-
metadata.customMetadata = @{@"a" : @"b", @"c" : @"d"};
646+
metadata.customMetadata = @{@"c" : @"d", @"y" : @""};
647647

648648
[ref updateMetadata:metadata
649649
completion:^(FIRStorageMetadata *updatedMetadata, NSError *error) {
650650
XCTAssertNil(error);
651651
[self assertMetadata:updatedMetadata
652652
contentType:@"content-type-b"
653-
customMetadata:@{@"a" : @"b", @"c" : @"d"}];
653+
654+
// "a" is now deleted and the empty string for "y" remains.
655+
customMetadata:@{@"c" : @"d", @"y" : @""}];
654656

655657
// Clear all metadata.
656658
FIRStorageMetadata *metadata = updatedMetadata;

0 commit comments

Comments
 (0)