@@ -125,6 +125,33 @@ func TestPrograms(t *testing.T) {
125125 readResponse (t , resp , & schema )
126126 })
127127 })
128+ t .Run (`Given an update temperature program endpoint,
129+ when a request is sent` , func (t * testing.T ) {
130+ t .Run (`without authorization,
131+ then it returns an authorized` , func (t * testing.T ) {
132+ resp , err = buildRequestAndSend (ctx , nil , nil , http2 .MethodPut , "/programs/temperature/20" , cl )
133+ require .NoError (t , err )
134+ require .Equal (t , http2 .StatusUnauthorized , resp .StatusCode )
135+ })
136+
137+ t .Run (`with authorization,
138+ then it returns an ok` , func (t * testing.T ) {
139+ updateTemp := http.UpdateTemperatureProgramRequestJson {
140+ {
141+ Executions : []http.UpdateExecutionTemperatureRequest {
142+ {
143+ Seconds : 10 ,
144+ Zones : []string {zo .Id ()},
145+ },
146+ },
147+ Hour : "17:00" ,
148+ },
149+ }
150+ resp , err = buildRequestAndSend (ctx , updateTemp , authorizationHeader (), http2 .MethodPut , "/programs/temperature/20" , cl )
151+ require .NoError (t , err )
152+ require .Equal (t , http2 .StatusOK , resp .StatusCode )
153+ })
154+ })
128155 t .Run (`Given a remove weekly program endpoint,
129156 when a request is sent` , func (t * testing.T ) {
130157 t .Run (`without authorization,
0 commit comments