IOS-291 removing save operations
authorXavier Algarra <xavier@pep-project.org>
Wed, 16 Nov 2016 10:41:48 +0100
changeset 10562d4d16e57cd7
parent 1055 fb838c433bc3
child 1057 41154e1a7830
IOS-291 removing save operations
pEpForiOS/UI/EmailDisplay/EmailListViewController.swift
pEpForiOS/UI/ImapSetup/SMTPSettingsTableView.swift
pEpForiOSTests/ObservableModelTest.swift
     1.1 --- a/pEpForiOS/UI/EmailDisplay/EmailListViewController.swift	Wed Nov 16 10:12:47 2016 +0100
     1.2 +++ b/pEpForiOS/UI/EmailDisplay/EmailListViewController.swift	Wed Nov 16 10:41:48 2016 +0100
     1.3 @@ -124,7 +124,6 @@
     1.4          // TODO: IOS 222: Save as draft
     1.5          if let folder = draftMessageToStore?.parent as? Folder {
     1.6              if folder.folderType == .drafts {
     1.7 -                message.save()
     1.8                  return
     1.9              }
    1.10          }
    1.11 @@ -134,7 +133,6 @@
    1.12          }
    1.13          
    1.14          if let folder = account.folder(ofType: FolderType.drafts) {
    1.15 -            folder.save(message: message)
    1.16              return
    1.17          }
    1.18      }
     2.1 --- a/pEpForiOS/UI/ImapSetup/SMTPSettingsTableView.swift	Wed Nov 16 10:12:47 2016 +0100
     2.2 +++ b/pEpForiOS/UI/ImapSetup/SMTPSettingsTableView.swift	Wed Nov 16 10:41:48 2016 +0100
     2.3 @@ -151,7 +151,6 @@
     2.4          credentials.needsVerification = true
     2.5          let account = Account.create(identity: identity, credentials: [credentials])
     2.6          account.needsVerification = true
     2.7 -        account.save()
     2.8      }
     2.9  
    2.10      @IBAction func nextButtonTapped(_ sender: UIBarButtonItem) {
     3.1 --- a/pEpForiOSTests/ObservableModelTest.swift	Wed Nov 16 10:12:47 2016 +0100
     3.2 +++ b/pEpForiOSTests/ObservableModelTest.swift	Wed Nov 16 10:41:48 2016 +0100
     3.3 @@ -25,6 +25,19 @@
     3.4      func testModelObserver() {
     3.5  
     3.6          class MockModel:ModelSaveProtocol {
     3.7 +            public struct ImapFlags {
     3.8 +                public var deleted = false
     3.9 +                public var draft = false
    3.10 +                public var flagged = false
    3.11 +                public var recent = false
    3.12 +                public var seen = false
    3.13 +            }
    3.14 +
    3.15 +            open var imapFlags: ImapFlags? = ImapFlags() {
    3.16 +                didSet{
    3.17 +                    notifyObserver()
    3.18 +                }
    3.19 +            }
    3.20              var dirty: Bool = false
    3.21              var saveIsCalled: XCTestExpectation?
    3.22              var mockProperty = "" {
    3.23 @@ -44,7 +57,8 @@
    3.24          let mm = MockModel();
    3.25          mm.saveIsCalled = expectation(description: "mm_dirty")
    3.26          XCTAssertFalse(mm.dirty)
    3.27 -        mm.mockProperty = "new string"
    3.28 +        //mm.mockProperty = "new string"
    3.29 +        mm.imapFlags?.draft = true
    3.30          XCTAssertTrue(mm.dirty)
    3.31          
    3.32          waitForExpectations(timeout: TestUtil.waitTime, handler: { (error) in