summaryrefslogtreecommitdiff
path: root/internal/db/bundb/relationship_test.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2023-07-08 16:43:12 +0200
committerLibravatar GitHub <noreply@github.com>2023-07-08 16:43:12 +0200
commitf40bb02f31ca72f1528cf40291e86024509e34d6 (patch)
tree9f68132057fc882a0b733ce037ea46bec0a3627b /internal/db/bundb/relationship_test.go
parent[docs] Clarify how to add a page (#1959) (diff)
downloadgotosocial-f40bb02f31ca72f1528cf40291e86024509e34d6.tar.xz
[bugfix] Delete mutual follow (requests) when receiving block from remote (#1960)
* [bugfix] Delete mutual follow (requests) on block * fix test
Diffstat (limited to 'internal/db/bundb/relationship_test.go')
-rw-r--r--internal/db/bundb/relationship_test.go15
1 files changed, 14 insertions, 1 deletions
diff --git a/internal/db/bundb/relationship_test.go b/internal/db/bundb/relationship_test.go
index 63fdb9632..d3f4a31d1 100644
--- a/internal/db/bundb/relationship_test.go
+++ b/internal/db/bundb/relationship_test.go
@@ -734,7 +734,7 @@ func (suite *RelationshipTestSuite) TestRejectFollowRequestNotExisting() {
targetAccount := suite.testAccounts["local_account_2"]
err := suite.db.RejectFollowRequest(ctx, account.ID, targetAccount.ID)
- suite.ErrorIs(err, db.ErrNoEntries)
+ suite.NoError(err)
}
func (suite *RelationshipTestSuite) TestGetAccountFollowRequests() {
@@ -836,6 +836,19 @@ func (suite *RelationshipTestSuite) TestGetFollowNotExisting() {
suite.Nil(follow)
}
+func (suite *RelationshipTestSuite) TestDeleteFollow() {
+ ctx := context.Background()
+ originAccount := suite.testAccounts["local_account_1"]
+ targetAccount := suite.testAccounts["admin_account"]
+
+ err := suite.db.DeleteFollow(ctx, originAccount.ID, targetAccount.ID)
+ suite.NoError(err)
+
+ follow, err := suite.db.GetFollow(ctx, originAccount.ID, targetAccount.ID)
+ suite.EqualError(err, db.ErrNoEntries.Error())
+ suite.Nil(follow)
+}
+
func (suite *RelationshipTestSuite) TestUnfollowRequestExisting() {
ctx := context.Background()
originAccount := suite.testAccounts["admin_account"]