FEATURE: allow user search API to restrict to group

This commit is contained in:
Sam Saffron
2017-02-09 18:45:39 -05:00
parent 1bcb835446
commit 4332f0dde1
5 changed files with 46 additions and 8 deletions

View File

@@ -43,6 +43,16 @@ describe UserSearch do
expect(search_for("under_").length).to eq(1)
end
it 'allows filtering by group' do
group = Fabricate(:group)
sam = Fabricate(:user, username: 'sam')
_samantha = Fabricate(:user, username: 'samantha')
group.add(sam)
results = search_for("sam", group: group)
expect(results.count).to eq(1)
end
# this is a seriously expensive integration test,
# re-creating this entire test db is too expensive reuse
it "operates correctly" do