Chage NewRequest methods, add multi description kind to thing
Since Reddit's API accepts form data as the body for most of its endpoints, it made sense to me to make the default NewRequest method set the request body as form data (if provided of course). The NewJSONRequest method can accept a JSON body. Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
This commit is contained in:
@@ -217,7 +217,7 @@ func TestMultiService_Delete(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
}
|
||||
|
||||
func TestMultiService_GetDescription(t *testing.T) {
|
||||
func TestMultiService_Description(t *testing.T) {
|
||||
client, mux, teardown := setup()
|
||||
defer teardown()
|
||||
|
||||
@@ -229,7 +229,7 @@ func TestMultiService_GetDescription(t *testing.T) {
|
||||
fmt.Fprint(w, blob)
|
||||
})
|
||||
|
||||
description, _, err := client.Multi.GetDescription(ctx, "user/testuser/m/testmulti")
|
||||
description, _, err := client.Multi.Description(ctx, "user/testuser/m/testmulti")
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, "hello world", description)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user