@@ -65,7 +65,7 @@ class QRLoginServiceRemoteTests: RemoteTestCase, RESTTestable {
6565 //
6666 func testInvalidJSON( ) {
6767 let expect = expectation ( description: " Validate the failure object is being returned " )
68- stubRemoteResponse ( " wpcom/v2/auth/qr-code/validate " , data: " foo " . data ( using: . utf8) !, contentType: . ApplicationJSON)
68+ stubRemoteResponse ( " wpcom/v2/auth/qr-code/validate " , data: " foo " . data ( using: . utf8) !, contentType: . ApplicationJSON)
6969
7070 qrLoginServiceRemote. validate ( token: " expired_token " , data: " expired_data " ) { _ in
7171 XCTFail ( " This request should not succeed " )
@@ -75,7 +75,6 @@ class QRLoginServiceRemoteTests: RemoteTestCase, RESTTestable {
7575 }
7676
7777 waitForExpectations ( timeout: timeout, handler: nil )
78-
7978 }
8079
8180 // MARK: - Authenticate Tests
@@ -102,7 +101,7 @@ class QRLoginServiceRemoteTests: RemoteTestCase, RESTTestable {
102101
103102 qrLoginServiceRemote. authenticate ( token: " valid_token " , data: " valid_data " ) { authenticated in
104103 XCTFail ( " This request should not succeed " )
105- } failure: { error in
104+ } failure: { error in
106105 expect. fulfill ( )
107106 }
108107
@@ -111,15 +110,16 @@ class QRLoginServiceRemoteTests: RemoteTestCase, RESTTestable {
111110
112111 // Calls the failure block when parsing invalid JSON
113112 func testAuthenticateInvalidJSON( ) {
114- let expect = expectation ( description: " Failed Authentication " )
115- stubRemoteResponse ( " wpcom/v2/auth/qr-code/authenticate " , data: " foo " . data ( using: . utf8) !, contentType: . ApplicationJSON)
116-
117- qrLoginServiceRemote. authenticate ( token: " valid_token " , data: " valid_data " ) { authenticated in
118- XCTFail ( " This request should not succeed " )
119- } failure: { error in
120- expect. fulfill ( )
121- }
113+ let expect = expectation ( description: " Failed Authentication " )
114+ stubRemoteResponse ( " wpcom/v2/auth/qr-code/authenticate " , data: " foo " . data ( using: . utf8) !, contentType: . ApplicationJSON)
122115
123- waitForExpectations ( timeout: timeout, handler: nil )
116+ qrLoginServiceRemote. authenticate ( token: " valid_token " , data: " valid_data " ) { authenticated in
117+ XCTFail ( " This request should not succeed " )
118+ } failure: { error in
119+ expect. fulfill ( )
124120 }
121+
122+ waitForExpectations ( timeout: timeout, handler: nil )
123+ }
125124}
125+
0 commit comments