Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

inline script src into fixture so that the event binding will actually work #156

Open
wants to merge 3 commits into
from

Conversation

Projects
None yet
1 participant
Contributor

jcouyang commented Nov 26, 2013

you can write your fixture like this

<div id="anchor_01"><script src="spec/fixtures/javascripts/jasmine_javascript_test.js"></script></div>

if the script contains event binding like

$(function (){ $('#anchor_01').click(function(){ $(this).addClass('foo'); }) });

the even will actually bind to fixture so you can write some jasmine test like

$('#anchor_01').click()
expect($("#anchor_01")).toHaveClass('foo')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment