Skip to content

Instantly share code, notes, and snippets.

@jnicklas
Created November 14, 2012 12:40
Show Gist options
  • Star 37 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save jnicklas/4071870 to your computer and use it in GitHub Desktop.
Save jnicklas/4071870 to your computer and use it in GitHub Desktop.
Capybara.add_selector :record do
xpath { |record| XPath.css("#" + ActionController::RecordIdentifier.dom_id(record)) }
match { |record| record.is_a?(ActiveRecord::Base) }
end
post = Post.first
find(post).click_link("Hello")
within post do
fill_in("What's going on here", :with => "Holy shit this works??")
click_button("Yes")
end
@JuarezLustosa
Copy link

\o/

@thiagofm
Copy link

nice

@sush
Copy link

sush commented Nov 14, 2012

Awesome ❤️

@pcreux
Copy link

pcreux commented Nov 15, 2012

😻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment