         
         sut.itemManager = ItemManager()
         
+        // Save calls addItem(_:) on a different thread, so the assertions will be called before the item is added to the item manager.
+        // We need to make this test asynchronous.
+        let expectationForItemSaved = expectation(description: "blah")
+        (sut as! MockInputViewController).completionHandler = {
+            expectationForItemSaved.fulfill()
+        }
+        
         sut.save()
         
         placemark = MockPlacemark()
         let coordinate = CLLocationCoordinate2D(latitude: 37.3316851, longitude: -122.0300674)
         placemark.mockCoordinate = coordinate
         mockGeocoder.completionHandler?([placemark], nil)
+        
+        waitForExpectations(timeout: 1, handler: nil)
         
         let item = sut.itemManager?.itemAtIndex(0)
         

    }
    
    func testSave_UsesGeocoderToGetCoordinateFromAddress() {
        sut.titleTextField.text = "test title"
        sut.dateTextField.text = "02/22/2016"
        sut.locationTextField.text = "test location"

        
        var dismissWasCalled: Bool = false
        
        var completionHandler: (()-> Void)?
        
        override func dismiss(animated flag: Bool, completion: (() -> Void)? = nil) {
            
            dismissWasCalled = true
            completionHandler?()
        }
    }
}
