mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Support multi-group user search
This commit is contained in:
committed by
Guo Xiang Tan
parent
8728850452
commit
e7ee556e87
@@ -51,10 +51,22 @@ describe UserSearch do
|
||||
_samantha = Fabricate(:user, username: 'samantha')
|
||||
group.add(sam)
|
||||
|
||||
results = search_for("sam", group: group)
|
||||
results = search_for("sam", groups: [group])
|
||||
expect(results.count).to eq(1)
|
||||
end
|
||||
|
||||
it 'allows filtering by multiple groups' do
|
||||
group_1 = Fabricate(:group)
|
||||
sam = Fabricate(:user, username: 'sam')
|
||||
group_2 = Fabricate(:group)
|
||||
samantha = Fabricate(:user, username: 'samantha')
|
||||
group_1.add(sam)
|
||||
group_2.add(samantha)
|
||||
|
||||
results = search_for("sam", groups: [group_1, group_2])
|
||||
expect(results.count).to eq(2)
|
||||
end
|
||||
|
||||
# this is a seriously expensive integration test,
|
||||
# re-creating this entire test db is too expensive reuse
|
||||
it "operates correctly" do
|
||||
|
||||
Reference in New Issue
Block a user