Skip to content
This repository has been archived by the owner on Jul 26, 2023. It is now read-only.

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

jcouyang
Copy link
Contributor

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant