Skip to content

Instantly share code, notes, and snippets.

@newtonapple
Created November 11, 2009 22:26
Show Gist options
  • Save newtonapple/232373 to your computer and use it in GitHub Desktop.
Save newtonapple/232373 to your computer and use it in GitHub Desktop.
RSpec Rails have_tag() example
response.should have_tag("form#my_form") do
have_tag('input#hidden_input_id[type=hidden][value=?]', 'secret')
end
# matches the following HTML:
# <form id="my_form" method="POST" action="create">
# <input id="hidden_input_id" value="secret" type="hidden" />
# </form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment