discourse/spec
Alan Guo Xiang Tan a473e352de
DEV: Introduce TopicGuardian#can_see_topic_ids method (#18692)
Before this commit, there was no way for us to efficiently check an
array of topics for which a user can see. Therefore, this commit
introduces the `TopicGuardian#can_see_topic_ids` method which accepts an
array of `Topic#id`s and filters out the ids which the user is not
allowed to see. The `TopicGuardian#can_see_topic_ids` method is meant to
maintain feature parity with `TopicGuardian#can_see_topic?` at all
times so a consistency check has been added in our tests to ensure that
`TopicGuardian#can_see_topic_ids` returns the same result as
`TopicGuardian#can_see_topic?`. In the near future, the plan is for us
to switch to `TopicGuardian#can_see_topic_ids` completely but I'm not
doing that in this commit as we have to be careful with the performance
impact of such a change.

This method is currently not being used in the current commit but will
be relied on in a subsequent commit.
2022-10-27 06:13:21 +08:00
..
fabricators DEV: Remove remaining hardcoded ids (#18735) 2022-10-25 15:29:09 +08:00
fixtures A11Y: Set role=presentation if alt attr is missing (#18546) 2022-10-12 14:07:37 +03:00
helpers FIX: Add theme-color <meta> tag when a dark scheme is selected (#18747) 2022-10-26 07:18:05 +03:00
import_export DEV: Add a rake task to export/import translation overrides (#18487) 2022-10-05 15:22:16 -04:00
initializers Add RSpec 4 compatibility (#17652) 2022-07-28 10:27:38 +08:00
integration DEV: Remove usages of enable_personal_messages (#18437) 2022-10-05 10:50:20 +10:00
integrity DEV: Use proper wording for contexts in specs 2022-08-04 11:05:02 +02:00
jobs FEATURE: Add dark mode option for category logos (#18460) 2022-10-07 11:00:44 -04:00
lib DEV: Introduce TopicGuardian#can_see_topic_ids method (#18692) 2022-10-27 06:13:21 +08:00
mailers DEV: Use proper wording for contexts in specs 2022-08-04 11:05:02 +02:00
models FIX: Log user addition/deletion from groups when they're changed via DiscourseConnect (#18677) 2022-10-25 11:25:26 +03:00
multisite DEV: Rename secure_media to secure_uploads (#18376) 2022-09-29 09:24:33 +10:00
requests DEV: Add missing assertion for InvitesController test (#18755) 2022-10-26 13:04:55 +01:00
script/import_scripts DEV: Remove remaining hardcoded ids (#18735) 2022-10-25 15:29:09 +08:00
serializers DEV: move BasicUserWithStatusSerializer from Discourse Chat (#18745) 2022-10-26 16:41:31 +04:00
services UX: Send notification of type replied to topic author if they're watching the topic (#18684) 2022-10-25 11:53:35 +03:00
support DEV: Introduce TopicGuardian#can_see_topic_ids method (#18692) 2022-10-27 06:13:21 +08:00
system DEV: Minimal first pass of rails system test setup (#16311) 2022-09-28 11:48:16 +10:00
tasks DEV: Fix flaky uploads:disable_secure_uploads spec (#18719) 2022-10-25 09:01:15 +10:00
views Add RSpec 4 compatibility (#17652) 2022-07-28 10:27:38 +08:00
rails_helper.rb FEATURE: Generic hashtag autocomplete part 1 (#18592) 2022-10-19 14:03:57 +10:00
regenerate_swagger_docs DEV: Add API docs for uploads and API doc watcher (#15387) 2021-12-23 08:40:15 +10:00
swagger_helper.rb DEV: Update rubocop (#18754) 2022-10-26 09:05:15 +08:00