summaryrefslogtreecommitdiff
path: root/internal/processing/fromfederator_test.go
diff options
context:
space:
mode:
authorLibravatar Daenney <daenney@users.noreply.github.com>2023-08-07 19:38:11 +0200
committerLibravatar GitHub <noreply@github.com>2023-08-07 18:38:11 +0100
commitbe3718f6e4c7bb229f9eb78b44c52d14399977cc (patch)
treea0efc132fbfb806227cc4b9af8bac9f5a5775c1c /internal/processing/fromfederator_test.go
parent[chore]: Bump github.com/tdewolff/minify/v2 from 2.12.7 to 2.12.8 (#2073) (diff)
downloadgotosocial-be3718f6e4c7bb229f9eb78b44c52d14399977cc.tar.xz
[chore] Use generic pointer function (#2080)
This replaces the different $TypePtr functions with a generic implementation.
Diffstat (limited to 'internal/processing/fromfederator_test.go')
-rw-r--r--internal/processing/fromfederator_test.go25
1 files changed, 13 insertions, 12 deletions
diff --git a/internal/processing/fromfederator_test.go b/internal/processing/fromfederator_test.go
index a981899d2..0b0e52811 100644
--- a/internal/processing/fromfederator_test.go
+++ b/internal/processing/fromfederator_test.go
@@ -32,6 +32,7 @@ import (
"github.com/superseriousbusiness/gotosocial/internal/id"
"github.com/superseriousbusiness/gotosocial/internal/messages"
"github.com/superseriousbusiness/gotosocial/internal/stream"
+ "github.com/superseriousbusiness/gotosocial/internal/util"
"github.com/superseriousbusiness/gotosocial/testrig"
)
@@ -110,10 +111,10 @@ func (suite *FromFederatorTestSuite) TestProcessReplyMention() {
InReplyToAccountID: repliedAccount.ID,
Visibility: gtsmodel.VisibilityUnlocked,
ActivityStreamsType: ap.ObjectNote,
- Federated: testrig.TrueBool(),
- Boostable: testrig.TrueBool(),
- Replyable: testrig.TrueBool(),
- Likeable: testrig.FalseBool(),
+ Federated: util.Ptr(true),
+ Boostable: util.Ptr(true),
+ Replyable: util.Ptr(true),
+ Likeable: util.Ptr(false),
}
wssStream, errWithCode := suite.processor.Stream().Open(context.Background(), repliedAccount, stream.TimelineHome)
@@ -317,9 +318,9 @@ func (suite *FromFederatorTestSuite) TestProcessAccountDelete() {
UpdatedAt: time.Now().Add(-1 * time.Hour),
AccountID: deletedAccount.ID,
TargetAccountID: receivingAccount.ID,
- ShowReblogs: testrig.TrueBool(),
+ ShowReblogs: util.Ptr(true),
URI: fmt.Sprintf("%s/follows/01FGRY72ASHBSET64353DPHK9T", deletedAccount.URI),
- Notify: testrig.FalseBool(),
+ Notify: util.Ptr(false),
}
err := suite.db.Put(ctx, zorkFollowSatan)
suite.NoError(err)
@@ -330,9 +331,9 @@ func (suite *FromFederatorTestSuite) TestProcessAccountDelete() {
UpdatedAt: time.Now().Add(-1 * time.Hour),
AccountID: receivingAccount.ID,
TargetAccountID: deletedAccount.ID,
- ShowReblogs: testrig.TrueBool(),
+ ShowReblogs: util.Ptr(true),
URI: fmt.Sprintf("%s/follows/01FGRYAVAWWPP926J175QGM0WV", receivingAccount.URI),
- Notify: testrig.FalseBool(),
+ Notify: util.Ptr(false),
}
err = suite.db.Put(ctx, satanFollowZork)
suite.NoError(err)
@@ -405,9 +406,9 @@ func (suite *FromFederatorTestSuite) TestProcessFollowRequestLocked() {
Account: originAccount,
TargetAccountID: targetAccount.ID,
TargetAccount: targetAccount,
- ShowReblogs: testrig.TrueBool(),
+ ShowReblogs: util.Ptr(true),
URI: fmt.Sprintf("%s/follows/01FGRYAVAWWPP926J175QGM0WV", originAccount.URI),
- Notify: testrig.FalseBool(),
+ Notify: util.Ptr(false),
}
err := suite.db.Put(ctx, satanFollowRequestTurtle)
@@ -462,9 +463,9 @@ func (suite *FromFederatorTestSuite) TestProcessFollowRequestUnlocked() {
Account: originAccount,
TargetAccountID: targetAccount.ID,
TargetAccount: targetAccount,
- ShowReblogs: testrig.TrueBool(),
+ ShowReblogs: util.Ptr(true),
URI: fmt.Sprintf("%s/follows/01FGRYAVAWWPP926J175QGM0WV", originAccount.URI),
- Notify: testrig.FalseBool(),
+ Notify: util.Ptr(false),
}
err := suite.db.Put(ctx, satanFollowRequestTurtle)