Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix param name in (Must)CreateRoom #679

Merged
merged 1 commit into from
Oct 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,18 +106,18 @@ func (c *CSAPI) DownloadContent(t TestLike, mxcUri string) ([]byte, string) {
}

// MustCreateRoom creates a room with an optional HTTP request body. Fails the test on error. Returns the room ID.
func (c *CSAPI) MustCreateRoom(t TestLike, creationContent map[string]interface{}) string {
func (c *CSAPI) MustCreateRoom(t TestLike, reqBody map[string]interface{}) string {
t.Helper()
res := c.CreateRoom(t, creationContent)
res := c.CreateRoom(t, reqBody)
mustRespond2xx(t, res)
body := ParseJSON(t, res)
return GetJSONFieldStr(t, body, "room_id")
resBody := ParseJSON(t, res)
return GetJSONFieldStr(t, resBody, "room_id")
}

// CreateRoom creates a room with an optional HTTP request body.
func (c *CSAPI) CreateRoom(t TestLike, creationContent map[string]interface{}) *http.Response {
func (c *CSAPI) CreateRoom(t TestLike, body map[string]interface{}) *http.Response {
t.Helper()
return c.Do(t, "POST", []string{"_matrix", "client", "v3", "createRoom"}, WithJSONBody(t, creationContent))
return c.Do(t, "POST", []string{"_matrix", "client", "v3", "createRoom"}, WithJSONBody(t, body))
}

// MustJoinRoom joins the room ID or alias given, else fails the test. Returns the room ID.
Expand Down
Loading