Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Capybara selector #18

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants

yelvert commented Oct 11, 2010

I made Capybara use css selectors by default rather than xpath. Simple 1-line change in the generated acceptance_helper.rb file. I only changed the rails 3 generator as I am unsure if the change would be different for rails 2.

Owner

cavalle commented Oct 12, 2010

Let me know if I'm wrong but AFAIK Capybara uses css as the default selector. So this patch seems unnecessary to me.

yelvert commented Oct 12, 2010

No, that was what i expected to, but it actually uses XPath as default. Cucumber sets its Capybara to css as well, refer to http://github.com/aslakhellesoy/cucumber-rails/blob/master/templates/install/support/capybara.rb

Owner

cavalle commented Oct 12, 2010

Apparently this changed some months ago:

http://github.com/jnicklas/capybara/commit/3b0d1d7e364fa4273e15fe0a5e14ab89528ef0d3

So currently (in 0.4.0.rc, which is a pre-release) default_selector is :css. I'm guessing 0.4.0 will be released soon so I don't see the need for patching steak.

Thanks for pointing it out, anyway!

yelvert commented Oct 12, 2010

I was unaware that they had changed it in the new version of Capybara, so i guess your right, it would be pointless to patch steak now.

This issue was closed.

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