summaryrefslogtreecommitdiff
path: root/internal/db/bundb/timeline_test.go
diff options
context:
space:
mode:
authorLibravatar Rob Sargant <robert@sargant.com>2022-11-14 09:30:01 +0000
committerLibravatar GitHub <noreply@github.com>2022-11-14 10:30:01 +0100
commitd120743e8bee74bbb6381a6ec017d7fa62b3f13e (patch)
tree166ab39f161b77cf6055abcc26de370c932c474f /internal/db/bundb/timeline_test.go
parent[chore]: Bump codeberg.org/gruf/go-cache/v3 from 3.1.7 to 3.1.8 (#1043) (diff)
downloadgotosocial-d120743e8bee74bbb6381a6ec017d7fa62b3f13e.tar.xz
[feature] add instance-expose-public-timeline flag (#1039)
* Add instance-expose-public-timeline flag Adds a config flag that allows unauthenticated access to /api/v1/timelines/public. Defaults to false to replicate existing behaviour. * Update structure following review * Add comment * Fix linting
Diffstat (limited to 'internal/db/bundb/timeline_test.go')
-rw-r--r--internal/db/bundb/timeline_test.go8
1 files changed, 2 insertions, 6 deletions
diff --git a/internal/db/bundb/timeline_test.go b/internal/db/bundb/timeline_test.go
index 8822879dd..9b6365621 100644
--- a/internal/db/bundb/timeline_test.go
+++ b/internal/db/bundb/timeline_test.go
@@ -35,23 +35,19 @@ type TimelineTestSuite struct {
}
func (suite *TimelineTestSuite) TestGetPublicTimeline() {
- viewingAccount := suite.testAccounts["local_account_1"]
-
- s, err := suite.db.GetPublicTimeline(context.Background(), viewingAccount.ID, "", "", "", 20, false)
+ s, err := suite.db.GetPublicTimeline(context.Background(), "", "", "", 20, false)
suite.NoError(err)
suite.Len(s, 6)
}
func (suite *TimelineTestSuite) TestGetPublicTimelineWithFutureStatus() {
- viewingAccount := suite.testAccounts["local_account_1"]
-
futureStatus := getFutureStatus()
if err := suite.db.Put(context.Background(), futureStatus); err != nil {
suite.FailNow(err.Error())
}
- s, err := suite.db.GetPublicTimeline(context.Background(), viewingAccount.ID, "", "", "", 20, false)
+ s, err := suite.db.GetPublicTimeline(context.Background(), "", "", "", 20, false)
suite.NoError(err)
suite.Len(s, 6)