I have the following code in an Ember View:
postRender: ->
@_super()
@$().tooltipster({
content: @$().data('tooltip')
contentAsHTML: true
})
I'm trying to test that tooltipster()
is called when postRender()
executes but I'm having some trouble spying on tooltipster()
with Sinon. Here's my spec so far:
describe 'postRender', ->
it 'initializes tooltips', ->
spy = sinon.spy(view.$(), 'tooltipster')
view.postRender()
spy.should.be.calledOnce
view.$().tooltipster.restore()
But that complains that view.$()
is undefined.
Any ideas on how to make this work?
Thanks!