 		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)
+	func testThatItInsertsAccount() {
+	
+		let fields: [String: Any?] = [
+			"Name" : "Megacorp, Inc.",
+			"BillingPostalCode": "12345",
+			"Website": URL(string: "http://megacorp.com")!,
+			"BillingStreet": nil
+		]
+		let exp = expectation(description: "Insert Account record")
+		
+		first {
+			salesforce.insert(type: "Account", fields: fields)
 		}.then {
 			// Then
-			id -> () in
+			id -> String in
 			XCTAssertTrue(id.hasPrefix("001"))
 			XCTAssertTrue(id.characters.count >= 15)
-			exp.fulfill()
-		}.catch {
-			error in
-			XCTFail(String(describing: error))
+			return id
+		}.then {
+			// Delete record that was just inserted
+			return self.salesforce.delete(type: "Account", id: $0)
+		}.then {
+			exp.fulfill()
+		}.catch {
+			XCTFail(String(describing: $0))
+		}
+		
+		waitForExpectations(timeout: 5.0, handler: nil)
+	}
+	
+	func testThatItInsertsTask() {
+		
+		let fields: [String: Any?] = [
+			"Subject" : "A Superhuman Task",
+			"IsReminderSet": true,
+			"ReminderDateTime": Date(timeIntervalSinceNow: 125000),
+			"ActivityDate": nil
+		]
+		let exp = expectation(description: "Insert Task record")
+		
+		first {
+			salesforce.insert(type: "Task", fields: fields)
+			}.then {
+				// Then
+				id -> String in
+				XCTAssertTrue(id.hasPrefix("00T"))
+				XCTAssertTrue(id.characters.count >= 15)
+				return id
+			}.then {
+				// Delete record that was just inserted
+				return self.salesforce.delete(type: "Task", id: $0)
+			}.then {
+				id in
+				exp.fulfill()
+			}.catch {
+				XCTFail(String(describing: $0))
 		}
 		
 		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 {
				error in
				XCTFail(String(describing: error))
		}
		waitForExpectations(timeout: 5.0, handler: nil)
	}

	
	func testThatItDeletes() {
		
		let fields = [ "Name" : "Worldwide Stuff, Inc.", "BillingPostalCode": "44554"]
		let exp = expectation(description: "Delete Account record")
		
		first {
			// Insert it
			salesforce.insert(type: "Account", fields: fields)
		}.then {
			// Delete it
			(id: String) -> Promise<String> in
			return self.salesforce.delete(type: "Account", id: id).then { id }
		}.then {
			// Try to query it
			(id: String) -> Promise<QueryResult<SObject>> in
			return self.salesforce.query(soql: "SELECT Id FROM Account WHERE Id = '\(id)'")
		}.then {
			// Then shoudn't be found
			(queryResult: QueryResult) -> Void in
			XCTAssert(queryResult.totalSize == 0)
			exp.fulfill()
		}.catch {
			XCTFail(String(describing: $0))
		}
		
		waitForExpectations(timeout: 5.0, handler: nil)
