mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Restrict token look ups by id to not conflict with other tests
This commit is contained in:
parent
c07ce3bd89
commit
de45c08585
1 changed files with 5 additions and 0 deletions
|
@ -34,6 +34,7 @@ describe "UserEmails", ->
|
|||
(cb) =>
|
||||
db.tokens.find {
|
||||
use: 'email_confirmation',
|
||||
'data.user_id': @user._id,
|
||||
usedAt: { $exists: false }
|
||||
}, (error, tokens) =>
|
||||
# There should only be one confirmation token at the moment
|
||||
|
@ -61,6 +62,7 @@ describe "UserEmails", ->
|
|||
(cb) =>
|
||||
db.tokens.find {
|
||||
use: 'email_confirmation',
|
||||
'data.user_id': @user._id,
|
||||
usedAt: { $exists: false }
|
||||
}, (error, tokens) =>
|
||||
# Token should be deleted after use
|
||||
|
@ -85,6 +87,7 @@ describe "UserEmails", ->
|
|||
(cb) =>
|
||||
db.tokens.find {
|
||||
use: 'email_confirmation',
|
||||
'data.user_id': @user._id,
|
||||
usedAt: { $exists: false }
|
||||
}, (error, tokens) =>
|
||||
# There should only be one confirmation token at the moment
|
||||
|
@ -121,6 +124,7 @@ describe "UserEmails", ->
|
|||
(cb) =>
|
||||
db.tokens.find {
|
||||
use: 'email_confirmation',
|
||||
'data.user_id': @user2._id,
|
||||
usedAt: { $exists: false }
|
||||
}, (error, tokens) =>
|
||||
# The first token has been used, so this should be token2 now
|
||||
|
@ -165,6 +169,7 @@ describe "UserEmails", ->
|
|||
(cb) =>
|
||||
db.tokens.find {
|
||||
use: 'email_confirmation',
|
||||
'data.user_id': @user._id,
|
||||
usedAt: { $exists: false }
|
||||
}, (error, tokens) =>
|
||||
# There should only be one confirmation token at the moment
|
||||
|
|
Loading…
Reference in a new issue