mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
31 lines
731 B
CoffeeScript
31 lines
731 B
CoffeeScript
|
sinon = require('sinon')
|
||
|
chai = require('chai')
|
||
|
should = chai.should()
|
||
|
modulePath = "../../../app/js/Notifications.js"
|
||
|
SandboxedModule = require('sandboxed-module')
|
||
|
assert = require('assert')
|
||
|
|
||
|
user_id = "51dc93e6fb625a261300003b"
|
||
|
notification_key = '123434'
|
||
|
|
||
|
describe 'creating a user', ->
|
||
|
beforeEach ->
|
||
|
self = @
|
||
|
@findOneStub = sinon.stub()
|
||
|
@findStub = sinon.stub()
|
||
|
@saveStub = sinon.stub()
|
||
|
@updateStub = sinon.stub()
|
||
|
|
||
|
@mongojs = =>
|
||
|
notifications:
|
||
|
update: self.mongojsUpdate
|
||
|
find: @findStub
|
||
|
findOne: @findOneStub
|
||
|
save: @saveStub
|
||
|
update: @updateStub
|
||
|
|
||
|
@repository = SandboxedModule.require modulePath, requires:
|
||
|
'logger-sharelatex': log:->
|
||
|
'settings-sharelatex': {}
|
||
|
'mongojs':@mongojs
|