             break
         }
     }
+
+    func testErrorWithInvalidJSON() {
+        let requestError = RequestError(json: [:])
+
+        switch requestError {
+        case .apiError(let reason):
+            XCTAssertNil(reason)
+            break
+        }
+    }
 }

        errorFixture = try? Fixture.load(fileName: "Fixtures/RequestError.json")
    }

    func testErrorFromJSON() {
        let dictionary = errorFixture as! JSONDictionary
        let requestError = RequestError(json: dictionary)



class RequestErrorTests: XCTestCase {
    static var allTests = [
        ("testErrorWithValidJSON", testErrorWithValidJSON),
        ("testErrorWithInvalidJSON", testErrorWithInvalidJSON)
    ]

    var errorFixture: Any!
