mirror of
https://github.com/discourse/discourse.git
synced 2025-06-07 13:24:45 +08:00
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:
@ -44,7 +44,10 @@ RSpec.describe AboutSerializer do
|
|||||||
end
|
end
|
||||||
|
|
||||||
describe "#stats" do
|
describe "#stats" do
|
||||||
after { DiscoursePluginRegistry.reset! }
|
after do
|
||||||
|
DiscoursePluginRegistry.reset_register!(:private_stat)
|
||||||
|
DiscoursePluginRegistry.reset_register!(:exposable_stat)
|
||||||
|
end
|
||||||
|
|
||||||
let(:plugin) { Plugin::Instance.new }
|
let(:plugin) { Plugin::Instance.new }
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ RSpec.describe UserBookmarkListSerializer do
|
|||||||
user_bookmark
|
user_bookmark
|
||||||
end
|
end
|
||||||
|
|
||||||
after { DiscoursePluginRegistry.reset! }
|
after { DiscoursePluginRegistry.reset_register!(:bookmarkables) }
|
||||||
|
|
||||||
let(:post_bookmark) { Fabricate(:bookmark, user: user, bookmarkable: Fabricate(:post)) }
|
let(:post_bookmark) { Fabricate(:bookmark, user: user, bookmarkable: Fabricate(:post)) }
|
||||||
let(:topic_bookmark) { Fabricate(:bookmark, user: user, bookmarkable: Fabricate(:topic)) }
|
let(:topic_bookmark) { Fabricate(:bookmark, user: user, bookmarkable: Fabricate(:topic)) }
|
||||||
|
@ -385,7 +385,7 @@ RSpec.describe UserSerializer do
|
|||||||
plugin.allow_public_user_custom_field :public_field
|
plugin.allow_public_user_custom_field :public_field
|
||||||
end
|
end
|
||||||
|
|
||||||
after { DiscoursePluginRegistry.reset! }
|
after { DiscoursePluginRegistry.reset_register!(:public_user_custom_fields) }
|
||||||
|
|
||||||
it "serializes the fields listed in public_user_custom_fields" do
|
it "serializes the fields listed in public_user_custom_fields" do
|
||||||
expect(json[:custom_fields]["public_field"]).to eq(user.custom_fields["public_field"])
|
expect(json[:custom_fields]["public_field"]).to eq(user.custom_fields["public_field"])
|
||||||
|
Reference in New Issue
Block a user