Created
September 24, 2013 08:45
-
-
Save mcansky/6682036 to your computer and use it in GitHub Desktop.
testing dom manipulation with Jasmine
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(window){ | |
add_pic = function (options) { | |
$('#pic').append("<img href='http://google.com/logo.jpg'/>"); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe "dom manipulation", -> | |
beforeEach -> | |
el = "<div id='pic'></div>" | |
$(document.body).append el | |
afterEach -> | |
$('#pic').remove() | |
it "should add an element to pic", -> | |
add_pic() | |
expect($('#pic').children().length).toEqual 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment