@@ -1083,19 +1083,30 @@ func TestSettings(t *testing.T) {
10831083 Header ("location" ).IsEqual (testInstance .DefaultRedirection ().String ())
10841084 })
10851085
1086- t .Run ("PutAvatar" , func (t * testing.T ) {
1087- e := testutils .CreateTestClient (t , ts .URL )
1088- sessCookie := session .CookieName (testInstance )
1086+ t .Run ("Avatar" , func (t * testing.T ) {
1087+ t .Run ("Put" , func (t * testing.T ) {
1088+ e := testutils .CreateTestClient (t , ts .URL )
1089+ sessCookie := session .CookieName (testInstance )
10891090
1090- // Create a sample avatar image
1091- avatarContent := "fake image content"
1091+ // Create a sample avatar image
1092+ avatarContent := "fake image content"
10921093
1093- e .PUT ("/settings/avatar" ).
1094- WithCookie (sessCookie , "connected" ).
1095- WithHeader ("Authorization" , "Bearer " + token ).
1096- WithHeader ("Content-Type" , "image/png" ).
1097- WithBytes ([]byte (avatarContent )).
1098- Expect ().Status (204 )
1094+ e .PUT ("/settings/avatar" ).
1095+ WithCookie (sessCookie , "connected" ).
1096+ WithHeader ("Authorization" , "Bearer " + token ).
1097+ WithHeader ("Content-Type" , "image/png" ).
1098+ WithBytes ([]byte (avatarContent )).
1099+ Expect ().Status (204 )
1100+ })
1101+
1102+ t .Run ("Delete" , func (t * testing.T ) {
1103+ e := testutils .CreateTestClient (t , ts .URL )
1104+ sessCookie := session .CookieName (testInstance )
1105+ e .DELETE ("/settings/avatar" ).
1106+ WithCookie (sessCookie , "connected" ).
1107+ WithHeader ("Authorization" , "Bearer " + token ).
1108+ Expect ().Status (204 )
1109+ })
10991110 })
11001111}
11011112
0 commit comments