describe('when initialized without value', function () {
      beforeEach(function () {
        ctx.instance = Foo.create()
      })

      itValidatesTheProperty(ctx, false, 'Missing required property bar')
      itValidatesOnUpdate(ctx, 'symbol', 'Expected property bar to be a symbol')
    })
    describe('when initialized with string value', function () {
      beforeEach(function () {
        ctx.instance = Foo.create({bar: 'baz'})
      })

      itValidatesTheProperty(ctx, false, 'Expected property bar to be a symbol')
      itValidatesOnUpdate(ctx, 'symbol', 'Expected property bar to be a symbol')
    })
Example #3
0
    describe('when initialized without value', function () {
      beforeEach(function () {
        ctx.instance = Foo.create()
      })

      itValidatesTheProperty(ctx, false)
      itValidatesOnUpdate(ctx, 'bool', 'Expected property bar to be a boolean')
    })
Example #4
0
    describe('when initialized with number value', function () {
      beforeEach(function () {
        ctx.instance = Foo.create({bar: 1})
      })

      itValidatesTheProperty(ctx, false, 'Expected property bar to be an array')
      itValidatesOnUpdate(ctx, 'array', 'Expected property bar to be an array')
    })
Example #5
0
    describe('when initialized with regexp value', function () {
      beforeEach(function () {
        ctx.instance = Foo.create({bar: /./})
      })

      itValidatesTheProperty(ctx, false)
      itValidatesOnUpdate(ctx, 'regexp', 'Expected property bar to be a regular expression')
    })
    describe('when initialized with date value', function () {
      beforeEach(function () {
        ctx.instance = Foo.create({bar: new Date()})
      })

      itValidatesTheProperty(ctx, false)
      itValidatesOnUpdate(ctx, 'date', 'Expected property bar to be a date')
    })
Example #7
0
    describe('when initialized with a SafeString object value', function () {
      beforeEach(function () {
        ctx.instance = Foo.create({bar: Ember.String.htmlSafe('baz')})
      })

      itValidatesTheProperty(ctx, false)
      itValidatesOnUpdate(ctx, 'string', 'Expected property bar to be a string')
    })
    describe('when initialized with element value', function () {
      beforeEach(function () {
        ctx.instance = Foo.create({bar: document.createElement('div')})
      })

      itValidatesTheProperty(ctx, false)
      itValidatesOnUpdate(ctx, 'element', 'Expected property bar to be an element')
    })
    describe('when initialized with object value', function () {
      beforeEach(function () {
        ctx.instance = Foo.create({bar: {}})
      })

      itValidatesTheProperty(ctx, false)
      itValidatesOnUpdate(ctx, 'object', 'Expected property bar to be an object')
    })