This repository has been archived by the owner on Jul 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use correct API in readyHandler (#516)
- Loading branch information
1 parent
b2c0d99
commit 451872f
Showing
3 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package util_test | ||
|
||
import ( | ||
"net/http/httptest" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
|
||
"github.com/grafana/phlare/pkg/util" | ||
) | ||
|
||
func TestWriteTextResponse(t *testing.T) { | ||
w := httptest.NewRecorder() | ||
|
||
util.WriteTextResponse(w, "hello world") | ||
|
||
assert.Equal(t, 200, w.Code) | ||
assert.Equal(t, "hello world", w.Body.String()) | ||
assert.Equal(t, "text/plain", w.Header().Get("Content-Type")) | ||
} |