overleaf/services/notifications/test/unit/coffee/NotificationsTests.coffee

31 lines
731 B
CoffeeScript
Raw Normal View History

2016-01-14 07:35:16 -05:00
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