mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
add test to explicitely check filter
This commit is contained in:
parent
e4da748257
commit
7726314e7c
1 changed files with 8 additions and 0 deletions
|
@ -69,6 +69,14 @@ describe "UserGetter", ->
|
|||
user.should.deep.equal @fakeUser
|
||||
done()
|
||||
|
||||
it "query contains $exists:true so partial index is used", (done)->
|
||||
expectedQuery =
|
||||
emails: { $exists: true }
|
||||
'emails.email': ''
|
||||
@UserGetter.getUserByAnyEmail '', {}, (error, user) =>
|
||||
@findOne.calledWith(expectedQuery, {}).should.equal true
|
||||
done()
|
||||
|
||||
it "checks main email as well", (done)->
|
||||
@findOne.callsArgWith(2, null, null)
|
||||
email = 'hello@world.com'
|
||||
|
|
Loading…
Reference in a new issue