IOS-937 testOutgoingColors red: undoLastMistrust does not lead to yellow
authorDirk Zimmermann <dirk@pep-project.org>
Fri, 09 Feb 2018 15:47:17 +0100
changeset 4442a0cd682d1f7
parent 443 10ec442ed3ad
child 445 3027e25306ea
IOS-937 testOutgoingColors red: undoLastMistrust does not lead to yellow
pEpObjCTests/PEPSessionTest.m
     1.1 --- a/pEpObjCTests/PEPSessionTest.m	Fri Feb 09 15:40:34 2018 +0100
     1.2 +++ b/pEpObjCTests/PEPSessionTest.m	Fri Feb 09 15:47:17 2018 +0100
     1.3 @@ -259,6 +259,7 @@
     1.4      // mistrust Bob
     1.5      [session keyMistrusted:identBob];
     1.6  
     1.7 +    identBob.fingerPrint = nil;
     1.8      [session updateIdentity:identBob];
     1.9      XCTAssertNil(identBob.fingerPrint);
    1.10  
    1.11 @@ -266,12 +267,15 @@
    1.12      clr = [session outgoingColorForMessage:msg];
    1.13      XCTAssertEqual(clr, PEP_rating_unencrypted);
    1.14  
    1.15 -    // Undon
    1.16 +    // Undo
    1.17      [session undoLastMistrust];
    1.18 +    [session updateIdentity:identBob];
    1.19 +    XCTAssertNotNil(identBob.fingerPrint);
    1.20  
    1.21      // Back to yellow
    1.22      clr = [session outgoingColorForMessage:msg];
    1.23      XCTAssertEqual(clr, PEP_rating_reliable);
    1.24 +    XCTAssertEqual([session identityRating:identBob], PEP_rating_reliable);
    1.25  
    1.26      // Trust again
    1.27      [session trustPersonalKey:identBob];