Created
December 16, 2011 19:55
-
-
Save cjolly/1487668 to your computer and use it in GitHub Desktop.
Toolin around with try-jasmine.heroku.com
This file contains hidden or 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
$("#edit").live "click", -> | |
$('.editable').each (i, el) -> | |
input = $('<input/>', | |
id: $(el).attr('id') + '_field' | |
value: $(el).text() | |
) | |
$(el).append(input) |
This file contains hidden or 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 "pressing the edit button", -> | |
container = undefined | |
button = undefined | |
beforeEach -> | |
@$container = inject('my-form') | |
@$editable_div = @$container.inject( | |
el: 'div' | |
class: 'editable', | |
id: 'full_name' | |
text: 'Rick Pulaski' | |
) | |
@$button = inject( | |
el: 'button' | |
id: "edit" | |
) | |
it "switches editable fields to inputs with value in field", -> | |
$("#edit").click() | |
expect($("#full_name_field").val()).toEqual "Rick Pulaski" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment