@@ -102,22 +102,20 @@ func TestAPI_StartDeviceFlow(t *testing.T) {
102
102
srv := setupServer (t , withAdminUser )
103
103
routes := srv .GenerateRoutes ()
104
104
105
- u := "https://api.example.com:2020/api/device"
106
- req , err := http .NewRequest (http .MethodPost , u , nil )
107
- assert .NilError (t , err )
105
+ req := httptest .NewRequest (http .MethodPost , "/api/device" , nil )
108
106
req .Header .Set ("Infra-Version" , apiVersionLatest )
109
107
resp := httptest .NewRecorder ()
110
108
routes .ServeHTTP (resp , req )
111
109
112
110
flowResp := & api.DeviceFlowResponse {}
113
- err = json .NewDecoder (resp .Body ).Decode (flowResp )
111
+ err : = json .NewDecoder (resp .Body ).Decode (flowResp )
114
112
assert .NilError (t , err )
115
113
116
114
assert .Equal (t , resp .Code , http .StatusCreated , (* responseDebug )(resp ))
117
115
expected := & api.DeviceFlowResponse {
118
116
DeviceCode : "<any-string>" ,
119
117
UserCode : "<any-string>" ,
120
- VerificationURI : "https://api. example.com:2020 /device" ,
118
+ VerificationURI : "https://example.com/device" ,
121
119
ExpiresInSeconds : 600 ,
122
120
PollIntervalSeconds : 5 ,
123
121
}
0 commit comments