DEV: Fix bookmark flaky (#24327)

Fixes this problem that happens sometimes in specs:

> Mocha::StubbingError:
> #<Mock:0x135150> was instantiated in one test but it is receiving
invocations within another test. This can lead to unintended
interactions between tests and hence unexpected test failures. Ensure
that every test correctly cleans up any state that it introduces.
This commit is contained in:
Martin Brennan 2023-11-10 20:16:22 +10:00 committed by GitHub
parent de8c8f1d28
commit a8d6dc4d3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -35,6 +35,8 @@ describe UsersController do
sign_in(current_user)
end
after { DiscoursePluginRegistry.reset_register!(:bookmarkables) }
it "does not return any unread notifications for chat bookmarks that the user no longer has access to" do
bookmark_with_reminder =
Fabricate(:bookmark, user: current_user, bookmarkable: bookmark_message)