From f518f649f800e52d32fe53580c528ffa042f7154 Mon Sep 17 00:00:00 2001 From: zowhoey <11893985+zowhoey@users.noreply.github.com> Date: Mon, 6 Mar 2023 09:30:19 +0000 Subject: [feature] Add support for profile fields (#1483) * Add go-playground/form pkg * [feature] Add support for profile fields * Add field attributes test * Validate profile fields form * Add profile field validation tests * Add Field Attributes definition to swagger --------- Co-authored-by: tobi <31960611+tsmethurst@users.noreply.github.com> --- internal/api/client/accounts/accountupdate_test.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'internal/api/client/accounts/accountupdate_test.go') diff --git a/internal/api/client/accounts/accountupdate_test.go b/internal/api/client/accounts/accountupdate_test.go index f898e64da..4e4e03fa4 100644 --- a/internal/api/client/accounts/accountupdate_test.go +++ b/internal/api/client/accounts/accountupdate_test.go @@ -38,12 +38,14 @@ type AccountUpdateTestSuite struct { func (suite *AccountUpdateTestSuite) TestAccountUpdateCredentialsPATCHHandler() { // set up the request - // we're updating the note of zork + // we're updating the note and profile fields of zork newBio := "this is my new bio read it and weep" requestBody, w, err := testrig.CreateMultipartFormData( "", "", map[string]string{ - "note": newBio, + "note": newBio, + "fields_attributes[0][name]": "pronouns", + "fields_attributes[0][value]": "they/them", }) if err != nil { panic(err) @@ -74,6 +76,7 @@ func (suite *AccountUpdateTestSuite) TestAccountUpdateCredentialsPATCHHandler() // check the returned api model account // fields should be updated suite.Equal("
this is my new bio read it and weep
", apimodelAccount.Note) + suite.Equal("they/them", apimodelAccount.Fields[0].Value) suite.Equal(newBio, apimodelAccount.Source.Note) } -- cgit v1.2.3