(t *testing.T, ctx context.Context, s *UsersStore)
| 1346 | } |
| 1347 | |
| 1348 | func usersIsFollowing(t *testing.T, ctx context.Context, s *UsersStore) { |
| 1349 | usersStore := newUsersStore(s.db) |
| 1350 | alice, err := usersStore.Create(ctx, "alice", "alice@example.com", CreateUserOptions{}) |
| 1351 | require.NoError(t, err) |
| 1352 | bob, err := usersStore.Create(ctx, "bob", "bob@example.com", CreateUserOptions{}) |
| 1353 | require.NoError(t, err) |
| 1354 | |
| 1355 | got := s.IsFollowing(ctx, alice.ID, bob.ID) |
| 1356 | assert.False(t, got) |
| 1357 | |
| 1358 | err = s.Follow(ctx, alice.ID, bob.ID) |
| 1359 | require.NoError(t, err) |
| 1360 | got = s.IsFollowing(ctx, alice.ID, bob.ID) |
| 1361 | assert.True(t, got) |
| 1362 | |
| 1363 | err = s.Unfollow(ctx, alice.ID, bob.ID) |
| 1364 | require.NoError(t, err) |
| 1365 | got = s.IsFollowing(ctx, alice.ID, bob.ID) |
| 1366 | assert.False(t, got) |
| 1367 | } |
| 1368 | |
| 1369 | func usersUnfollow(t *testing.T, ctx context.Context, s *UsersStore) { |
| 1370 | usersStore := newUsersStore(s.db) |
nothing calls this directly
no test coverage detected