FIX: better filter for groups search (#14262)

Follow up of https://github.com/discourse/discourse/pull/14216

Allow plugins to register custom filter with block
This commit is contained in:
Krzysztof Kotlarek
2021-09-08 09:38:45 +10:00
committed by GitHub
parent cddba50570
commit e3793e6d7c
9 changed files with 108 additions and 47 deletions

View File

@ -935,18 +935,6 @@ describe Group do
expect(Group.search_groups('sOmEthi')).to eq([group])
expect(Group.search_groups('test2')).to eq([])
end
it 'allows to filter with additional scope' do
messageable_group
expect(Group.search_groups('es', custom_scope: { name: :messageable, arguments: [user] }).sort).to eq([messageable_group, group].sort)
plugin = Plugin::Instance.new
plugin.register_group_scope_for_search(:messageable)
expect(Group.search_groups('es', custom_scope: { name: :messageable, arguments: [user] }).sort).to eq([messageable_group].sort)
DiscoursePluginRegistry.reset!
end
end
describe '#bulk_add' do