@@ -94,9 +94,26 @@ class TestCompass: XCTestCase {
9494 self . waitForExpectationsWithTimeout ( 4.0 , handler: nil )
9595 }
9696
97+ func testParseRegularURLWithSlashQuery( ) {
98+ let expectation = self . expectationWithDescription ( " Parse URL with slash query " )
99+ let url = NSURL ( string: " compassTests://callback/?access_token=Yo0OMrVZbRWNmgA6BT99hyuTUTNRGvqEEAQyeN1eslclzhFD0M8AidB4Z7Vs2NU8WoSNW0vYb961O38l&token_type=Bearer&expires_in=3600 " ) !
100+
101+ Compass . parse ( url) { route, arguments in
102+ XCTAssertEqual ( route, " callback " )
103+ XCTAssertEqual ( arguments. count, 3 )
104+ XCTAssertEqual ( arguments [ " access_token " ] , " Yo0OMrVZbRWNmgA6BT99hyuTUTNRGvqEEAQyeN1eslclzhFD0M8AidB4Z7Vs2NU8WoSNW0vYb961O38l " )
105+ XCTAssertEqual ( arguments [ " expires_in " ] , " 3600 " )
106+ XCTAssertEqual ( arguments [ " token_type " ] , " Bearer " )
107+
108+ expectation. fulfill ( )
109+ }
110+
111+ self . waitForExpectationsWithTimeout ( 4.0 , handler: nil )
112+ }
113+
97114 func testParseRegularURLWithQuery( ) {
98115 let expectation = self . expectationWithDescription ( " Parse URL with query " )
99- let url = NSURL ( string: " compassTests://callback/ ?access_token=Yo0OMrVZbRWNmgA6BT99hyuTUTNRGvqEEAQyeN1eslclzhFD0M8AidB4Z7Vs2NU8WoSNW0vYb961O38l&token_type=Bearer&expires_in=3600 " ) !
116+ let url = NSURL ( string: " compassTests://callback?access_token=Yo0OMrVZbRWNmgA6BT99hyuTUTNRGvqEEAQyeN1eslclzhFD0M8AidB4Z7Vs2NU8WoSNW0vYb961O38l&token_type=Bearer&expires_in=3600 " ) !
100117
101118 Compass . parse ( url) { route, arguments in
102119 XCTAssertEqual ( route, " callback " )
0 commit comments