DEV: More targeted cleanup in plugin registry specs (#31333)

When running core specs with `LOAD_PLUGINS=1`,
`DiscoursePluginRegistry.reset!` throws a warning. Using specific
cleanup ensures that doesn't happen.
This commit is contained in:
Penar Musaraj
2025-02-14 10:28:29 -05:00
committed by GitHub
parent e5eeb642b9
commit b01d4b1951
3 changed files with 6 additions and 3 deletions

View File

@ -385,7 +385,7 @@ RSpec.describe UserSerializer do
plugin.allow_public_user_custom_field :public_field
end
after { DiscoursePluginRegistry.reset! }
after { DiscoursePluginRegistry.reset_register!(:public_user_custom_fields) }
it "serializes the fields listed in public_user_custom_fields" do
expect(json[:custom_fields]["public_field"]).to eq(user.custom_fields["public_field"])