Sha256: 35b5a76a7c0e29af7dfce9e0d2e4d53bf1e50ba33eb826bde3da64397374c1eb

Contents?: true

Size: 751 Bytes

Versions: 4

Compression:

Stored size: 751 Bytes

Contents

describe 'Base', ->

  describe 'class functions', ->

    beforeEach ->
      class MyClass extends Streusel.Base

      @subject = MyClass

    it 'computes selector based on class name', ->
      expect(@subject.selector()).toEqual('[data-streusel-myclass]')

    it 'assigns object to tags', ->
      tag1 = affix('#c1[data-streusel-myclass]')
      tag2 = affix('#c2[data-streusel-myclass]')

      objects = @subject.init()
      expect(objects).toBeDefined()
      expect(objects.length).toEqual(2)
      expect(objects[0]).toBeDefined()

      expect(tag1.data('object')).toBeDefined()
      expect(tag1.data('object')).toEqual(objects[0])
      expect(tag2.data('object')).toBeDefined()
      expect(tag2.data('object')).toEqual(objects[1])

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
partystreusel-1.0.3 spec/javascripts/partystreusel/base_spec.js.coffee
partystreusel-1.0.2 spec/javascripts/partystreusel/base_spec.js.coffee
partystreusel-1.0.1 spec/javascripts/partystreusel/base_spec.js.coffee
partystreusel-1.0.0 spec/javascripts/partystreusel/base_spec.js.coffee