mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-11 03:07:29 -06:00
Merge branch 'main' into content_warning_fixes
This commit is contained in:
commit
aa5713fc38
26 changed files with 572 additions and 26 deletions
|
|
@ -211,6 +211,36 @@ func (suite *StatusCreateTestSuite) TestProcessReplyToUnthreadedRemoteStatus() {
|
|||
suite.NotEmpty(dbStatus.ThreadID)
|
||||
}
|
||||
|
||||
func (suite *StatusCreateTestSuite) TestProcessNoContentTypeUsesDefault() {
|
||||
ctx := context.Background()
|
||||
creatingAccount := suite.testAccounts["local_account_1"]
|
||||
creatingApplication := suite.testApplications["application_1"]
|
||||
|
||||
statusCreateForm := &apimodel.StatusCreateRequest{
|
||||
Status: "poopoo peepee",
|
||||
SpoilerText: "",
|
||||
MediaIDs: []string{},
|
||||
Poll: nil,
|
||||
InReplyToID: "",
|
||||
Sensitive: false,
|
||||
Visibility: apimodel.VisibilityPublic,
|
||||
LocalOnly: util.Ptr(false),
|
||||
ScheduledAt: nil,
|
||||
Language: "en",
|
||||
ContentType: "",
|
||||
}
|
||||
|
||||
apiStatus, errWithCode := suite.status.Create(ctx, creatingAccount, creatingApplication, statusCreateForm)
|
||||
suite.NoError(errWithCode)
|
||||
suite.NotNil(apiStatus)
|
||||
|
||||
suite.Equal("<p>poopoo peepee</p>", apiStatus.Content)
|
||||
|
||||
// the test accounts don't have settings, so we're comparing to
|
||||
// the global default value instead of the requester's default
|
||||
suite.Equal(apimodel.StatusContentTypeDefault, apiStatus.ContentType)
|
||||
}
|
||||
|
||||
func TestStatusCreateTestSuite(t *testing.T) {
|
||||
suite.Run(t, new(StatusCreateTestSuite))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue