Adding basic tests for RocketChat.models._Base

pull/1045/head
George Secrieru 10 years ago
parent 3f158ee015
commit ef5435bcdd
  1. 24
      packages/rocketchat-lib/tests/jasmine/server/unit/models/_Base.spec.coffee

@ -0,0 +1,24 @@
describe 'rocketchat:lib Server | Models | Base', ->
beforeEach ->
MeteorStubs.install()
this.obj = new RocketChat.models._Base
afterEach ->
MeteorStubs.uninstall()
it 'should exist', ->
expect(this.obj).toBeDefined()
it 'should provide a basename for collections', ->
expect(typeof this.obj._baseName()).toBe('string')
it 'should carry a Meteor.Collection object when initialized', ->
expect(this.obj.model).toBeFalsy()
expect(this.obj._initModel('carry')).toBeTruthy()
expect(typeof this.obj.model).toBe('object')
it 'should apply a basename to the Meteor.Collection created', ->
name = 'apply'
expect(this.obj._initModel(name)).toBeTruthy()
expect(this.obj.model._name).toBe(this.obj._baseName() + name)
Loading…
Cancel
Save