 
         expect(result?.error).toEventually(equal(TODOAPIClientError.unknownError(code: 418)))
     }
-//
-//    func testParsesTaskProperlyGettingTaskById() {
-//        _ = stubRequest("GET", "http://jsonplaceholder.typicode.com/todos/1")
-//            .andReturn(200)?
-//            .withBody(fromJsonFile("getTaskByIdResponse"))
-//
-//        var result: Result<TaskDTO, TODOAPIClientError>?
-//        apiClient.getTaskById("1") { response in
-//            result = response
-//        }
-//
-//        expect(result).toEventuallyNot(beNil())
-//        assertTaskContainsExpectedValues((result?.value)!)
-//    }
-//
-//    func testReturnsItemNotFoundErrorIfTheTaskIdDoesNotExist() {
-//        _ = stubRequest("GET", "http://jsonplaceholder.typicode.com/todos/1")
-//            .andReturn(404)
-//
-//        var result: Result<TaskDTO, TODOAPIClientError>?
-//        apiClient.getTaskById("1") { response in
-//            result = response
-//        }
-//
-//        expect(result?.error).toEventually(equal(TODOAPIClientError.itemNotFound))
-//    }
-//
-//    func testReturnsNetworkErrorIfThereIsNoConnectionGettingTaskById() {
-//        _ = stubRequest("GET", "http://jsonplaceholder.typicode.com/todos/1")
-//            .andFailWithError(NSError.networkError())
-//
-//        var result: Result<TaskDTO, TODOAPIClientError>?
-//        apiClient.getTaskById("1") { response in
-//            result = response
-//        }
-//
-//        expect(result?.error).toEventually(equal(TODOAPIClientError.networkError))
-//    }
-//
-//    func testReturnsUnknowErrorIfTheErrorIsNotHandledGettingTasksById() {
-//        _ = stubRequest("GET", "http://jsonplaceholder.typicode.com/todos/1")
-//            .andReturn(418)
-//
-//        var result: Result<TaskDTO, TODOAPIClientError>?
-//        apiClient.getTaskById("1") { response in
-//            result = response
-//        }
-//
-//        expect(result?.error).toEventually(equal(TODOAPIClientError.unknownError(code: 418)))
-//    }
-//
+
+    func testParsesTaskProperlyGettingTaskById() {
+        stub(condition: isMethodGET() &&
+            isHost("jsonplaceholder.typicode.com") &&
+            isPath("/todos/1")) { _ in
+                let stubPath = OHPathForFile("getTaskByIdResponse.json", type(of: self))
+                return fixture(filePath: stubPath!, status: 200, headers: ["Content-Type":"application/json"])
+        }
+
+        var result: Result<TaskDTO, TODOAPIClientError>?
+        apiClient.getTaskById("1") { response in
+            result = response
+        }
+
+        expect(result).toEventuallyNot(beNil())
+        assertTaskContainsExpectedValues((result?.value)!)
+    }
+
+    func testReturnsItemNotFoundErrorIfTheTaskIdDoesNotExist() {
+        stub(condition: isMethodGET() &&
+            isHost("jsonplaceholder.typicode.com") &&
+            isPath("/todos/1")) { _ in
+                return fixture(filePath: "", status: 404, headers: ["Content-Type":"application/json"])
+        }
+
+        var result: Result<TaskDTO, TODOAPIClientError>?
+        apiClient.getTaskById("1") { response in
+            result = response
+        }
+
+        expect(result?.error).toEventually(equal(TODOAPIClientError.itemNotFound))
+    }
+
+    func testReturnsNetworkErrorIfThereIsNoConnectionGettingTaskById() {
+        stub(condition: isMethodGET() &&
+            isHost("jsonplaceholder.typicode.com") &&
+            isPath("/todos/1")) { _ in
+                let notConnectedError = NSError(domain: NSURLErrorDomain, code: URLError.notConnectedToInternet.rawValue)
+                return OHHTTPStubsResponse(error:notConnectedError)
+        }
+
+        var result: Result<TaskDTO, TODOAPIClientError>?
+        apiClient.getTaskById("1") { response in
+            result = response
+        }
+
+        expect(result?.error).toEventually(equal(TODOAPIClientError.networkError))
+    }
+
+    func testReturnsUnknowErrorIfTheErrorIsNotHandledGettingTasksById() {
+        stub(condition: isMethodGET() &&
+            isHost("jsonplaceholder.typicode.com") &&
+            isPath("/todos/1")) { _ in
+                return fixture(filePath: "", status: 418, headers: ["Content-Type":"application/json"])
+        }
+
+        var result: Result<TaskDTO, TODOAPIClientError>?
+        apiClient.getTaskById("1") { response in
+            result = response
+        }
+
+        expect(result?.error).toEventually(equal(TODOAPIClientError.unknownError(code: 418)))
+    }
+
     func testSendsTheCorrectBodyAddingANewTask() {
         stub(condition: isMethodPOST() &&
             isHost("jsonplaceholder.typicode.com") &&

                return fixture(filePath: "", status: 418, headers: ["Content-Type":"application/json"])
        }


        var result: Result<[TaskDTO], TODOAPIClientError>?
        apiClient.getAllTasks { response in
            result = response

    }

}

