summaryrefslogtreecommitdiff
path: root/internal/processing/status/create_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/processing/status/create_test.go')
-rw-r--r--internal/processing/status/create_test.go30
1 files changed, 30 insertions, 0 deletions
diff --git a/internal/processing/status/create_test.go b/internal/processing/status/create_test.go
index 16cefcebf..ec1ded3b0 100644
--- a/internal/processing/status/create_test.go
+++ b/internal/processing/status/create_test.go
@@ -238,6 +238,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))
}