From 8118795a86ab32c43e4baebaa2953a079d712468 Mon Sep 17 00:00:00 2001 From: kolaente Date: Thu, 12 Jan 2023 17:14:17 +0100 Subject: [PATCH] fix(tests): subscription test fixtures --- pkg/db/fixtures/subscriptions.yml | 9 +++++++-- pkg/models/subscription_test.go | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/pkg/db/fixtures/subscriptions.yml b/pkg/db/fixtures/subscriptions.yml index 1f3620791..7f97ca40b 100644 --- a/pkg/db/fixtures/subscriptions.yml +++ b/pkg/db/fixtures/subscriptions.yml @@ -5,12 +5,12 @@ created: 2021-02-01 15:13:12 - id: 3 entity_type: 2 # project - entity_id: 12 # belongs to parent project 7 TODO + entity_id: 12 # belongs to parent project 7 user_id: 6 created: 2021-02-01 15:13:12 - id: 4 entity_type: 3 # Task - entity_id: 22 # belongs to project 13 which belongs to namespace 8 TODO + entity_id: 22 # belongs to project 13 user_id: 6 created: 2021-02-01 15:13:12 - id: 6 @@ -23,3 +23,8 @@ entity_id: 26 user_id: 6 created: 2021-02-01 15:13:12 +- id: 8 + entity_type: 2 # Project + entity_id: 32 + user_id: 6 + created: 2021-02-01 15:13:12 diff --git a/pkg/models/subscription_test.go b/pkg/models/subscription_test.go index 8dd02d07c..a5b5b3867 100644 --- a/pkg/models/subscription_test.go +++ b/pkg/models/subscription_test.go @@ -295,11 +295,11 @@ func TestSubscriptionGet(t *testing.T) { s := db.NewSession() defer s.Close() - // Task 21 belongs to project 12 which the user has subscribed to + // Task 21 belongs to project 32 which the user has subscribed to sub, err := GetSubscription(s, SubscriptionEntityTask, 21, u) assert.NoError(t, err) assert.NotNil(t, sub) - assert.Equal(t, int64(3), sub.ID) + assert.Equal(t, int64(8), sub.ID) }) }) t.Run("invalid type", func(t *testing.T) {