summaryrefslogtreecommitdiff
path: root/internal/db/bundb/relationship_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/db/bundb/relationship_test.go')
-rw-r--r--internal/db/bundb/relationship_test.go27
1 files changed, 27 insertions, 0 deletions
diff --git a/internal/db/bundb/relationship_test.go b/internal/db/bundb/relationship_test.go
index 9e5a71d60..0e38d19fe 100644
--- a/internal/db/bundb/relationship_test.go
+++ b/internal/db/bundb/relationship_test.go
@@ -28,6 +28,7 @@ import (
"github.com/superseriousbusiness/gotosocial/internal/db"
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
"github.com/superseriousbusiness/gotosocial/internal/id"
+ "github.com/superseriousbusiness/gotosocial/testrig"
)
type RelationshipTestSuite struct {
@@ -861,6 +862,32 @@ func (suite *RelationshipTestSuite) TestUnfollowRequestNotExisting() {
suite.Nil(followRequest)
}
+func (suite *RelationshipTestSuite) TestUpdateFollow() {
+ ctx := context.Background()
+
+ follow := &gtsmodel.Follow{}
+ *follow = *suite.testFollows["local_account_1_admin_account"]
+
+ follow.Notify = testrig.TrueBool()
+ if err := suite.db.UpdateFollow(ctx, follow, "notify"); err != nil {
+ suite.FailNow(err.Error())
+ }
+
+ dbFollow, err := suite.db.GetFollowByID(ctx, follow.ID)
+ if err != nil {
+ suite.FailNow(err.Error())
+ }
+
+ suite.True(*dbFollow.Notify)
+
+ relationship, err := suite.db.GetRelationship(ctx, follow.AccountID, follow.TargetAccountID)
+ if err != nil {
+ suite.FailNow(err.Error())
+ }
+
+ suite.True(relationship.Notifying)
+}
+
func TestRelationshipTestSuite(t *testing.T) {
suite.Run(t, new(RelationshipTestSuite))
}