summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicoleYarroch <nicole@livio.io>2021-04-28 07:37:58 -0400
committerNicoleYarroch <nicole@livio.io>2021-04-28 07:37:58 -0400
commit85c9b2a4d2c9ea061b0310d44e916a00d2d4ee0a (patch)
treee63f34475cd5ecdbb7b837a015bb7f63a3e0d773
parent981b80a3a217b0a7e31f16e7dd3d78d85c1ccbfc (diff)
downloadsdl_ios-bugfix/issue_1975_encrypted_listFiles_breaks_fileManager.tar.gz
Signed-off-by: NicoleYarroch <nicole@livio.io>
-rw-r--r--SmartDeviceLinkTests/DevAPISpecs/SDLFileManagerSpec.m23
1 files changed, 9 insertions, 14 deletions
diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLFileManagerSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLFileManagerSpec.m
index 83a2f8a4d..b663009a7 100644
--- a/SmartDeviceLinkTests/DevAPISpecs/SDLFileManagerSpec.m
+++ b/SmartDeviceLinkTests/DevAPISpecs/SDLFileManagerSpec.m
@@ -143,20 +143,7 @@ describe(@"uploading / deleting single files with the file manager", ^{
});
});
- describe(@"after receiving a ListFiles error due to the file manager not being able to start", ^{
- beforeEach(^{
- SDLListFilesOperation *operation = testFileManager.pendingTransactions.firstObject;
- operation.completionHandler(NO, initialSpaceAvailable, testInitialFileNames, [NSError sdl_fileManager_unableToStartError]);
- });
-
- it(@"should handle the error properly", ^{
- expect(testFileManager.currentState).to(match(SDLFileManagerStateStartupError));
- expect(testFileManager.remoteFileNames).to(beEmpty());
- expect(@(testFileManager.bytesAvailable)).to(equal(initialSpaceAvailable));
- });
- });
-
- describe(@"getting an error from the module to a ListFiles request", ^{
+ describe(@"getting an error for a ListFiles request", ^{
__block SDLListFilesOperation *operation = nil;
beforeEach(^{
@@ -186,6 +173,14 @@ describe(@"uploading / deleting single files with the file manager", ^{
expect(testFileManager.remoteFileNames).to(beEmpty());
expect(@(testFileManager.bytesAvailable)).to(equal(initialSpaceAvailable));
});
+
+ it(@"should transition to the error state if it gets a ListFiles error without a resultCode", ^{
+ operation.completionHandler(NO, initialSpaceAvailable, testInitialFileNames, [NSError sdl_fileManager_unableToStartError]);
+
+ expect(testFileManager.currentState).to(match(SDLFileManagerStateStartupError));
+ expect(testFileManager.remoteFileNames).to(beEmpty());
+ expect(@(testFileManager.bytesAvailable)).to(equal(initialSpaceAvailable));
+ });
});
describe(@"after receiving a ListFiles response", ^{