 				}
 				exp.fulfill()
 			}.catch {
-				error in
-				XCTFail(String(describing: error))
+				XCTFail(String(describing: $0))
 		}
 		waitForExpectations(timeout: 5.0, handler: nil)
 	}

		waitForExpectations(timeout: 5.0, handler: nil)
	}
	
	func testThatItInserts() {
		
		// Note: will insert records into org
		
		let type = "Account"
		let fields = [ "Name" : "Megacorp, Inc.", "BillingPostalCode": "12345"]
		let exp = expectation(description: "Insert \(type) record")
		
		first {
			salesforce.insert(type: type, fields: fields)
		}.then {
			// Then
			id -> () in
			XCTAssertTrue(id.hasPrefix("001"))
			XCTAssertTrue(id.characters.count >= 15)
			exp.fulfill()
		}.catch {
			error in
			XCTFail(String(describing: error))
		}
		
		waitForExpectations(timeout: 5.0, handler: nil)

		let type = "Account"
		let exp = expectation(description: "Describe Account")
		
		salesforce.describe(type: type).then {
			(desc: ObjectMetadata) -> () in
			let fields = Dictionary(items: desc.fields!) { $0.name }
			XCTAssertEqual(desc.name, "Account")
			XCTAssertTrue(fields.count > 0)
			XCTAssertNotNil(fields["Type"])
			XCTAssertEqual(fields["Type"]!.type, "picklist")
			exp.fulfill()
		}.catch {
			XCTFail(String(describing: $0))
		}
		waitForExpectations(timeout: 5.0, handler: nil)
	}
