Created
          November 14, 2012 12:40 
        
      - 
      
- 
        Save jnicklas/4071870 to your computer and use it in GitHub Desktop. 
  
    
      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
    
  
  
    
  | Capybara.add_selector :record do | |
| xpath { |record| XPath.css("#" + ActionController::RecordIdentifier.dom_id(record)) } | |
| match { |record| record.is_a?(ActiveRecord::Base) } | |
| end | 
  
    
      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
    
  
  
    
  | 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 | 
nice
\o/
nice
Awesome ❤️
😻
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
            
🍻