Skip to content

Instantly share code, notes, and snippets.

@mikedfunk
Created October 21, 2011 19:55
Show Gist options
  • Save mikedfunk/1304787 to your computer and use it in GitHub Desktop.
Save mikedfunk/1304787 to your computer and use it in GitHub Desktop.
qunit test
test('loading_in()', function()
{
// setup
var the_html = '<a class="click_me">initial text</a>';
$('#qunit-fixture').html(the_html);
// run function
loading_in($('a.click_me'));
// test
ok($('.click_me').hasClass('disabled'), 'Is it disabled?');
equal($('.click_me').html(), 'Loading...', 'Right content?');
// tear down
$('#qunit-fixture').empty();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment