Skip to content

Commit 9c9e8f1

Browse files
committed
Add test case for symbol url query parameters
1 parent e7e36f0 commit 9c9e8f1

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

APIKitTests/RequestTests.swift

+19-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class RequestTests: XCTestCase {
3333
super.tearDown()
3434
}
3535

36-
func testURLQueryParameterEncoding() {
36+
func testJapanesesURLQueryParameterEncoding() {
3737
OHHTTPStubs.stubRequestsPassingTest({ request in
3838
XCTAssert(request.URL?.query == "q=%E3%81%93%E3%82%93%E3%81%AB%E3%81%A1%E3%81%AF")
3939
return true
@@ -50,4 +50,22 @@ class RequestTests: XCTestCase {
5050

5151
waitForExpectationsWithTimeout(1.0, handler: nil)
5252
}
53+
54+
func testSymbolURLQueryParameterEncoding() {
55+
OHHTTPStubs.stubRequestsPassingTest({ request in
56+
XCTAssert(request.URL?.query == "q=%21%22%23%24%25%26%27%28%290%3D~%7C%60%7B%7D%2A%2B%3C%3E%3F_")
57+
return true
58+
}, withStubResponse: { request in
59+
return OHHTTPStubsResponse(data: NSData(), statusCode: 200, headers: nil)
60+
})
61+
62+
let request = SearchRequest(query: "!\"#$%&'()0=~|`{}*+<>?_")
63+
let expectation = expectationWithDescription("waiting for the response.")
64+
65+
API.sendRequest(request) { result in
66+
expectation.fulfill()
67+
}
68+
69+
waitForExpectationsWithTimeout(1.0, handler: nil)
70+
}
5371
}

0 commit comments

Comments
 (0)