-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Capybara rack_test driver should *not* respect data-method #184
Comments
I agree, but last time this discussion came up I was the only one objecting and a lot of people wanted this. I think that since this is now the expected behaviour we shouldn't just randomly break it. I think the sensible way would be to make this a driver configuration option for the rack-test driver, so to switch it off you'd have to do (wordy, I know):
If we find that there is support for this, we'll change the default. Thoughts? |
Would you be able to point me to the relevant discussions you've had in the past please? As for your suggestion, I think that'd definitely be a start, and it would give people that were aware of the issue a chance to have their tests fail rather than magically pass. I wonder if we could take that slightly further and emit a warning if respect_data_method is set to true. Or be slightly clever and only warn if it's set to true yet rails.js is missing (not foolproof by any means I realise). Actually, I've just had another thought. Could we introduce a specific Rails 3 driver that knows about these special attributes? I'm still not massively keen even on that idea because if someone uses that and doesn't have the stock rails.js file they're still not testing against a realistic environment. I've created a simple test to expose one side of the problem - where another rack app uses data-method in a way that's incompatible with the Rails 3 use[1] [1] https://github.com/chrisroos/capybara-data-method-naughtiness |
Well, we already have a capybara/rails file, so we could set |
I have run into a similar situation which I submitted as an issue but then found this one already open. I ended up having to patch the Capybara::RackTest::Node.click method in order to get Capybara to ignore data-method. I too think there should be some kind of option to turn this behavior off. |
This will be the default in Capybara 2.0 |
See also #478 |
This change enables the `:respect_data_method` option from the RackTest driver for Rails projects that don't use RSpec.
Kalv raised this[1] recently and I know you responded in the comments there. I'd just like to add my voice and say that I really disagree with Capybara knowing anything about Rails 3 behaviour. I can understand that it might not be desirable to just remove it (although that'd be my preference) but I'd at least like to be able to discuss it. Where's the best place for that?
Cheers, Chris
[1] http://kalv.co.uk/2010/10/27/stop-being-clever-capybara/
The text was updated successfully, but these errors were encountered: