Skip to content

Instantly share code, notes, and snippets.

@aiwilliams
Created May 19, 2011 21:09
Show Gist options
  • Save aiwilliams/981750 to your computer and use it in GitHub Desktop.
Save aiwilliams/981750 to your computer and use it in GitHub Desktop.
# Setting values on what I know are single objects in the DOM...
child = @child
@$('input[name=name]').each -> @value = child.name
@$('input[name=invite]').each -> @checked = child.invite
# Reading them in tests...
it 'should include the name in a text field', ->
input = view.$('input[name=name]')[0]
expect(input.value).toBe('Bobby')
it 'should include an invite checkbox', ->
input = view.$('input[type=checkbox]')[0]
expect(input.checked).toBe(true)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment